Viswamitra and the two princes are on their way to Mithila. They come across a beautiful asrama that was once occupied by Sage Goutama and his wife Ahalya. Indra, the king of gods, sinned by falling in love with the beautiful Ahalya. One day, when Goutama was away for his morning ablutions, Indra took the guise of the sage and approached Ahalya. Though Ahalya knew it was Indra who was before her, she yielded to his lust. Later they became conscious of the enormity of the sin they have committed. Panic-stricken, Indra was beginning to flee when he almost bumped into the sage. He prostrated before the all-knowing sage and begged for his mercy. The sage blazing in anger, cursed Indra and turned him into a eunuch. Goutama, then prescribed for his wife a long penance till Lord Sri Rama sets his lotus-feet in the asrama. According to some versions of the Ramayana, Goutama’s curse turned Ahalya into a stone.
As per the instruction of Viswamitra, Sri Rama enters the asrama. Ahalya, purified by her penance, is liberated from the curse.