In the
Ramayana, the
Linga Purana and the
Mahabharata, Ila grows to become the king of
Bahlika. While hunting in a forest, Ila accidentally trespassed Sharavana ("Forest of Reeds"), the sacred grove of the goddess
Parvati. Upon entering Sharavana, all-male beings except for her husband
Shiva, including trees and animals, are transformed into females. One legend tells that a female
yakshini disguised herself as a deer and purposefully led Ila to the grove in order to save her husband from the king. The
Bhagavata Purana et al. texts tell that Ila's entire entourage, as well as his horse, also changed their genders. and ordered them to run away, promising that they would find mates as Ilā had. Ilā married Budha and spent an entire month with him and consummated the marriage. However, Ilā woke one morning as Sudyumna and remembered nothing about the past month.
Budha told Ila that his retinue had been killed in a rain of stones and convinced Ila to stay with him for a year. During each month she spent as a woman, Ilā had a good time with Budha. During each month as a man, Ila turned to pious ways and performed austerities under the guidance of Budha. In the ninth month, Ilā gave birth to
Pururavas, who grew to become the first king of the Lunar dynasty. Then, as per the advice of Budha and Ila's father Kardama, Ila pleased Shiva and Shiva restored Ila's masculinity permanently. The
Bhagavata Purana et al. texts tell that after Pururavas's birth, the nine brothers of Ila – by horse-sacrifice – or the sage Vasistha – the family priest of Ila – pleased Shiva to compel him to give the boon of alternate month manhood to Ila, turning him into a
Kimpurusha. According to another account found in the
Vayu Purana and the
Brahmanda Purana, Ilā was born female, married Budha, then was transformed into a male called Sudyumna. Sudyumna was then cursed by Parvati and transformed once again into a female, but became a man once again through Shiva's boon. ==Later life and descendants==