Sage Agasthya, stung by his wife Lopamudra's complaint that he had not provided her with clothes and ornaments befitting a princess, had come out of his hermitage insearch of enough wealth to fulfil her desires.
During his wanderings, he came upon a piece of rockon which, he thought, he saw an image of Vighneswara.Pleased with his prayers, the Lord appeared before him. The sage now very much wanted to have the rock carved into a statue of Vighneswara.
In the forest dwelled two rakshasas, Vatapi and Ilval,who indulged in magic to rob the wayfarers of the money and other wealth they carried with them. They accosted Agasthya and began playing tricks on him. The sage, however,guessed who they were and thwarted their attempts. Soon,the rakshasas were taking totheir heels to save them selves from shame.
Agasthya then found their hide-out and came upon the wealth they had collected from innocent people. He called everybody from the neighbourhood and distribute da portion of the wealth to them. With the remaining money, goldcoins and ornaments, and precious stones, Agasthya thought of raising a whole city which would give shelterto many people, who would then lead a peaceful life.
Soon, a city rose around the rock on which the sagehad seen the image of Vighneswara. It was named after Vatapi. The sage had codes of conduct and administration inscribed in every nook and corner of the city. The people conducted their own affairs in a very democratic way. Ultimately, Vatapinagari became an ideal city.
Agasthya now turned his attention to carving a statue of Vighneswara. He found that his wife Lopamudra wasa good artist. She inspected the rock and drew a picture of the Lord which could be the model for the statue. However, Agasthya could not find a competent sculptorto carve the image. The sage spent days looking at the picture and at the rock.
Some sculptors, on seeing the rock, commented that it was no ordinary rock, and it had some particles ofdiamond, which gave a peculiar sheen to the rock. Theysaid, only the devas or yakshas would be able to sculpt and that, too, with specialchisels which had some divine quality