Viracocha the great creator god in the pre-Inca and Inca mythology was the one that created the universe, sun, moon, stars, time and civilization itself. He also created mankind by breathing into stones, but his first creation were brainless giants that displeased him. So, he destroyed them with a flood and made new, better ones from smaller stones.
The Legend of Viracocha
At first there was only darkness, and within the darkness were the waters of the great lake, Titicaca. Then Viracocha, called Illa Ticsi Viracocha, the Bright One, the First One, the Foam of the Sea, came forth from the waters and made the earth and the sky. He created the first human beings. He disappeared, and still there was darkness.
But the first beings were displeasing to Viracocha and he emerged again from Lake Titicaca, and many like himself - many viracochas - were with him. He turned the first beings into stone, as a punishment for the anger they had caused him. Then he created the sun and made it run in its proper course. Also, he created the moon and the stars, and he put them into the sky. This he did at Tiahuanaco.
And at Tiahuanaco he created new tribes of men, making each tribe from stone; and each tribe had its chieftain and its women who were pregnant and other women who had children on cradleboards. When the first tribe was finished, he set it aside there in Tiahuanaco, and he made another tribe and another. And on each of the figures he painted the dresses they were to wear, and those who were to wear their hair long were given long hair, and those who were to be shorn were shorn.
Then he summoned his viracochas and showed them all the tribes, telling them what each was to be named and where its home would be. He said: "As I have painter' them and made them of stone, so shall they issue from fountains, rivers, caves, and rocks in the provinces that I have indicated to you."
Then he sent his viracochas toward the sunrise, ordering them to call forth the tribes. Two of them, however, he kept with him, sending one southwestward toward the shoreline and the other northeastward toward the woody lowlands; and these two then traveled north, calling forth more tribes. Viracocha himself went between them, taking the royal road to Cuzco and Cajamarca, and he too called forth tribes.
As he traveled along, he carried a staff. He was old, they say, lean and bearded. His cloak was long, and his hair was long.
When he reached the district of Cacha, where the Canas were to be, then he called forth the Cana tribe. But they came out armed, and when they saw Viracocha, not knowing him, they rushed upon him, weapons in hand, intending to kill him. Seeing them coming, he made fire fall from the sky and burned a mountain close to where they were. They saw the fire and were terrified. Then they threw down their weapons and ran toward Viracocha, casting themselves on the ground before him. When he saw them like this, he took up his staff and struck at the fire, and it died out.
Then he told them that he was their Creator, and they built him a great temple and offered much gold and silver.
Afterward he came to Urcos, where he climbed to the top of a high mountain. There he sat down and commanded the people who lived in that place to emerge from the mountain. And because Viracocha sat down there, they built him a throne of gold.
From there he went on, calling forth the various tribes, until he reached Cuzco. In that place he brought forth the Alcahuizas, and he also named the site Cuzco; and he left instructions as to how the Incas were to be brought into being after his departure. Then he continued northward, calling forth the tribes.
At last he reached the coast in the district of Manta. And there, spreading his cloak, he moved on it over the waves and never reappeared, nor was he seen again. And because of the manner of his departure he was given the name Viracocha, the Foam of the Sea.