According to a legend mentioned in Kashi Khand when during Padma Kalp there was a severe drought all across the world, then all the creatures were severely afflicted by it. So, when Lord Brahma came to know about this he became worried as it was difficult for him to see his creation being on the verge of destruction. After a long search for a solution, Lord Brahma saw King Ripunjay who was dedicatedly engrossed in the penance. Being pleased by him, Lord Brahma renamed him to King Divodas and requested him to take the world under his throne and save the humanity. King agreed with this but he had one condition that he wanted to rule peacefully without intervention, so that he could reform the dharma without any disturbance. Therefore, he wished that all Gods and Godly entities should remain in the heaven only and should not return to land. Lord Brahma also kept a condition that King should be an excellent administrator and that every person staying in his kingdom or visiting his kingdom should be treated well with proper religious pursuits. King agreed.
On the command of Lord Brahma, all Gods left to the heaven. But, it was not easy for Lord Brahma to ask Lord Shiva to leave Kashi and go to heaven as Kashi is believed to be one of the favourite places of Lord Shiva. So, when being pleased with the prayers of Mandaranchal , Lord Shiva appeared in front of him and Mandaranchal asked Lord Shiva to reside upon him along with Goddess Parvati and his family as a boon, finding right time to aware Lord Shiva about King Divodas’ condition, Lord Brahma told Lord Shiva that how King Divodas can save humanity and about King’s condition that all gods should leave to heaven. As Lord Shiva could not deny the request of Lord Brahma, so he also left to Mandaranchal from Kashi. As per his condition, King Divodas took the throne and worked vigorously to bring order in the decaying world. With the favours obtained from Lord Brahma, king established a rule so flawless that was never seen before. Under his regime, his subjects prospered and justice flourished.
As time passed, Lord Shiva desired to again come back to his own city Kashi. But due to Brahma’s boon to Divodasa, he was unable to set feet in Kashi. Soon Lord Shiva came to know that other gods too are unable to stay in Kashi. Not happy with this kind of attitude of the Divodas, Lord Shiva decided first to cast some dents into the flawlessness of Divodas’ rule in order to reduce his powers and then to end his regime. For this purpose, he sent Yogini Mandal to Kashi. But when all the efforts made by Yogini Mandal sent by Lord Shiva to find out loop holes in the kingdom of King Divodas of Kashi failed, then Lord Shiva deputed Suryadev to go to Kashi and let him know about the condition of the city. On reaching Kashi, Suryadev was mesmerized by the beauty of the city. Thereafter, like Yoginis, Suryadev took different gestures and tried to find any loop hole in the kingdom of Divodas. But when failed, he established himself in different parts of Varanasi in twelve forms. Name of these twelve forms of Lord Surya are as follows:-