In the Puranas, Gunasharman’s story is nested within an episode about his father Adityasharman. The father used his great spiritual powers (tapas) to create an apsara (heavenly damsel) for himself, whom he named Sulocana. When a son, Gunasharman, was born to them, Adityasharman became a deva (god) and went to Brahmaloka (heaven). One day Indra came to visit Adityasharman, who could not be aroused from his contemplation. Indra was insulted and cursed him to be born a mortal again on earth. Adityasharman immediately became alert and tried to placate Indra’s anger. Indra decided that it would be punishment enough for his son Gunasharman to suffer the curse of his father.
Gunasharman grew up as a mortal and developed in all the sciences and arts, just as his father had done. He became an intimate of King Mahasena and Queen Asiokavati of Ujjayini. He even used his spiritual powers to rescue Mahasena when he was captured in battle. One day the king asked Gunasharman to give a dance performance, which he did with such beauty and grace that the king had Gunasharman teach dance to his wife. Naturally, the queen fell in love with her wonderful teacher. However, he rejected her love. Queen Asiokavati then told the king that Gunasharman had acted improperly toward her, so Gunasharman had to flee the palace, evading the king’s guards only by his magical powers. He hid in the hermitage of Agnidatta and married Agnidatta’s daughter, Sundari. There Gunasharman practiced austerities (tapas) to acquire more powers, propitiating Subrahmanya (also called Karttikeya, son of Siva and commander-in-chief of Siva‘s minions) and receiving martial powers from him. Then he returned to the kingdom of Ujjayini, used these powers to conquer it, and became its king. King Mahasena and Queen Asiokavati were exiled.Was dharma served? Perhaps Gunasharman completed the ritual to change caste from brahmin to ksatriya, but the myths do not add that detail.