Koirala secured 405 votes, Constituent Assembly chairman Surya Bahadur Thapa announced.
A total of 148 lawmakers, including from the Unified Communist Party of Nepal-Maoist (UCPN-Maoist) and some fringe parties voted against Koirala.
Koirala, 74, was the sole candidate for the post after a large number of political parties, including the Communist Party of Nepal-Unified Marxist-Leninist (CPN-UML), extended support for his bid.
Koirala’s administration will replace the incumbent interim government headed by Chief Justice Khil Raj Regmi.
Of the 30 political parties represented in the Constituent Assembly, 16 voted against Koirala — but he won on numbers.
With Koirala’s victory, the country got a new elected executive head — 21 months after the dissolution of the first Constituent Assembly and nearly three months after the second assembly was elected.
In his address to the house, the new prime minister assured promulgation of a federal democratic constitution within a year. He also assured using all the resources for the economic development of the country.
Koirala, who is single, belongs to Nepal’s famous Koirala clan which, like the Nehru-Gandhi family of India and the Bhuttos of Pakistan, has been deeply involved in the country’s democratic struggle.
He became the fourth prime minister from his family, after Matrika Prasad Koirala (1951-52 and 1953-55), Bishweshwar Prasad Koirala (1959-60) and Girija Prasad Koirala (1991-94, 1998-99, 2000-01 and 2007-08).
He has never held any public office in his political life so far.
A devoted member of the Nepali Congress party, Koirala once spent three years in Indian prisons for his involvement in a plane hijacking in 1974.
According to his former press adviser Bipul Pokhrel, Koirala was involved in the hijacking of a then Royal Nepal Airlines plane that was forced to land in Forbesgunj in India’s Bihar state.
Then he went underground and spent some time in Mumbai and Kalimpong. But he was arrested from Delhi and put in various jails like Tihar, Araria, Purnea and Bhagalpur for a total of three years.
According to the biography provided to IANS by his personal secretary Laxman Dhakal, Koirala left for Kolkata in 1960 after late King Mahendra imposed the party-less panchayat system and jailed many pro-democracy leaders.
Then he met Bidhan Chandra Roy, the then chief minister of West Bengal, seeking moral support for Nepal’s democratic movement and organised a press conference in Kolkata.
Later, Koirala established contact with Indian leaders like Jayaprakash Narayan, Ram Manohar Lohia, Ashok Mehta and Madhu Dandavate and informed them of the political situation in Nepal and sought moral support from Indian political parties.
While in exile, Koirala was the editor of Tarun, the official publication of the Nepali Congress.
He has been a member of the central working committee of the party since 1979 and was appointed general secretary in 1996 and vice president in 1998.
Koirala was appointed acting president of the party in 2008 by then president Girija Prasad Koirala. In September 2010, he was elected party president.
The Nepali Congress emerged as the largest party in the 2013 Constituent Assembly elections under Koirala’s leadership.
Koirala, after filing his nomination papers Sunday, had said: “We are hopeful that we will deliver a new constitution within a year. I will definitely work with the other parties to fulfill this historic responsibility.”