Brahmarshi Vishvamitra (Sanskrit: viśvā-mitra "friend of the world";Tamil: Vicuvāmittiraṉ; Thai: Swamit; Burmese: Bodaw; Javanese: Wiswamitra, Malay: Nila Purba) is one of the most venerated rishis or sages of ancient times in India. He is also credited as the author of most of Mandala 3 of the Rigveda, including the Gayatri Mantra. The Puranas mention that only 24 rishis since antiquity have understood the whole meaning of—and thus wielded the whole power of—the Gayatri Mantra. Vishvamitra is supposed to be the first, and Yajnavalkya the last.
The story of Vishvamitra is narrated in the Balakanda of Valmiki Ramayana. The Mahabharata adds that Vishvamitra's relationship with Menaka resulted in a daughter, Shakuntala, whose story is narrated in the Adi Parva of the Mahabharata.
Vishvamitra was a king in ancient India, also called Kaushika ("descendant of Kusha"). He was a valiant warrior and the great-grandson of a great king named Kusha. The Valmiki Ramayana, prose 51 of Bala Kanda, starts with the story of Vishvamitra:
There was a king named Kusha (not to be confused with Kusha, son of Rama), a brainchild of Brahma, and Kusha's son was the powerful and verily righteous Kushanabha. One who is highly renowned by the name Gaadhi was the son of Kushanabha, and Gaadhi's son is this great-saint of great resplendence, Vishvamitra. Vishvamitra ruled the earth, and this great-resplendent king ruled the kingdom for many thousands of years.
His story also appears in various Puranas; however, with variations from the Ramayana. The Vishnu Purana and Harivamsha chapter 27 (dynasty of Amaavasu) of Mahabharatha narrates the birth of Vishvamitra. According to Vishnu Purana, Kushanabha married a damsel of the Purukutsa dynasty (later called as Shatamarshana lineage - descendents of the Ikshvaku king Trasadasyu) and had a son by name Gaadhi, who had a daughter named Satyavati (not to be confused with the Satyavati of Mahabharata).
Satyavati was married to an old Brahmin known as Ruchika who was foremost among the race of Bhrigu. Ruchika desired a son having the qualities of a Brahmin, and so he gave Satyavati a sacrificial offering (charu) which he had prepared to achieve this objective. He also gave Satyavati's mother another charu to make her conceive a son with the character of a Kshatriya at her request. But Satyavati's mother privately asked Satyavati to exchange her charu with her. This resulted in Satyavati's mother giving birth to Vishvamitra, the son of a Kshatriya Gadhi with the qualities of a Brahmin; and Satyavati gave birth to Jamadagni, the father of Parashurama, a Brahmin with qualities of a Kshatriya.