The Janata Party was formed by political leaders and activists of various political parties who had been united in opposing the state of Emergency imposed in 1975 by then-Prime Minister Indira Gandhi. After elections were called in 1977, the Janata Party was formed from the union of the Congress (O), the Swatantra Party, the Socialist Party of India, the Jana Sangh and the Lok Dal. Jagjivan Ram split from the Indian National Congress, bringing a small faction known as the Congress for Democracy with him, and joined the Janata alliance. The widespread unpopularity of Emergency rule gave the Janata Party and its allies a landslide victory in the election. Morarji Desai became the Prime Minister of India, Advani became the Minister of Information and Broadcasting and Vajpayee became the Foreign Minister. The erstwhile members of the Jana Sangh, quit the Janata Party and they formed the new Bharatiya Janata Party. Advani became a prominent leader of the newly founded BJP and represented the party in the Rajya Sabha (upper house of the Indian Parliament) from Madhya Pradesh for two terms beginning in 1982.