Drupada had no children so he did austerities in the forest seeking the blessings of Shiva for begetting a son. Shiva granted him the boon that a girl would be born to him, but will transform into a boy later. As prophesied, Amba was reborn as Shikhandini, whose true gender was not disclosed and she was brought up as a boy. When Drupada got his daughter in the garb of a son married to the daughter of Hiranyavarna, the king of Dasharna, his true identity was revealed not only to the chagrin of the girl, her father but also to Shikandini himself. The agitated Hiranyavarna declared war on Panchala. Distressed by the turn of events, Shikhandini went into the forest to fast unto death but was saved by a yaksha (a forest deity), Sthunakarna, who helped him by offering his own gender in exchange to Shikandini’s female gender. Thus Shikhandini became the male Shikhandi. After Hiranyavarna’s death, Shikhandi returned to swap sexes with the yaksha, however the yaksha was cursed by his master the god Kubera to remain female until Shikhandi’s death.