Vishvamitra is at the center of many classical legends of Hinduism.
Originally King Kaushika in ancient India, he is said to have renounced his kingdom in order to acquire spiritual powers. This involved several tests and prolonged meditations, during which he was often tempted by the celestial nymphs, apsaras – one of whom succeeded and begat a daughter, Shakuntala (who would grow up to become the heroine of an epic in her own right, and bear the son Bharat, after whom the land would be named).
The king is said to have succeeded in becoming a brahmarishi – a sage of the highest order – and earning the title Vishvamitra (literally, a friend of everyone, in Sanskrit).
Retaining his royal temperament, he would display unusual anger as well as compassion – on one occasion compelling another legendary king, Rajah Harishchandra, to give up kingdom, while on another occasion creating an entire new heaven to lodge someone who had been denied entry into Paradise.
He was the mentor of the young Rama, the seventh incarnation of Vishnu according to the Hindu belief. He also received Gayatri, one of the most sacred mantras of the Vedas.
Iqbal adapted the mantra into an Urdu poem, ‘The Sun’, as early as 1902, and included it in The Call of the Marching Bell (1924). In Javid Nama (1932), Vishvamitra himself appears meditating in a cave on the Moon (caves have been a conventional preference for initiation rites, and hence the cave of Vishvamitra serves as the starting point for Iqbal’s celestial journey).