With support from the main opposition Unified Communist Party of Nepal-Maoist, the CPN (Unified Marxist-Leninist) chairman defeated outgoing prime minister and Nepali Congress leader Sushil Koirala in a keenly contested vote in parliament.
The 63-year-old Oli secured support of 338 lawmakers of 587 voting in the 599-seat house.
Oli, a chronic patient of kidney-related ailments, is known to be a hawkish politician, whose sharp-worded statements have made headlines in the media.
An earlier sharp critic of the Maoists, Oli joined hands with UCPN-Maoist chairman Pushpa Kamal Dahal 'Prachanda' to become the 38th prime minister of Nepal.
The key challenge for Oli now is addressing the demands of agitating Madhesh-based political parties and other groups over concerns related to the newly-promulgated constitution.
He also needs to carry out on war footing reconstruction and rehabilitation necessitated by the April 25 earthquake, restoring peace and tranquillity in the Nepal-India border area and working towards political stability.
Oli started his political career some 45 years back from Jhapa district in eastern Nepal. He represents Jhapa-7 constituency in parliament.
He served many years in jail during the partyless Panchayat era in Nepal before 1990 when the king was head of state.
He has served as home and foreign minister in the past.
Oli is married but has no children. He has no formal education from a college or a university but speaks several languages.
The 63-year-old leader was elected chief of the CPN-UML in July 2014, defeating Madhav Kumar Nepal, another former prime minister.
He was chief of the UML's international department before being elected to the top post in the party.
Oli had served as the deputy prime minister and minister for foreign affairs in the Girija Prasad Koirala-led interim government formed immediately after the 2006 People's Movement.
In 1994, he was minister for home affairs in the cabinet led by then UML chairman Man Mohan Adhikari.
He was elected a member of parliament thrice — in 1991, 1994 and 1999 — from various constituencies in Jhapa district.