Oli, who was appointed to the post on February 15, secured 208 votes out of total 268 Parliament members present in the House of Representatives, officials said.
The 66-year-old Oli received the backing of all political parties, except the main opposition, the Nepali Congress and some fringe parties who voted against him.
He received 121 votes from CPN-UML, 52 from CPN (Maoist Center), 16 each from Rastriya Janta Party Nepal and Federal Socialist Forum Nepal and one each from Rastriya Janamorcha, Rastriya Prajatantra Party, Nepal Workers Peasants Party and an independent lawmaker, the officials said.
Speaker of the Parliament Krishna Bahadur Mahara has announced next session of the Parliament on Friday.
More From This Section
Earlier, Oli had called on all political parties to support the government. The Nepali Congress had said it would not support Oli and play the role of an effective opposition.
According to the new Constitution, the Prime Minister needs to win a confidence motion in Parliament within six months after his appointment.
There are 275 members in the House of Representatives including 165 members elected under the first-past-the-post category or direct election and 110 under proportional representation basis.
Nepal's new government led by Left parties convened its first parliament session on March 5 after the Himalayan nation successfully held landmark provincial and federal elections.
There are 275 members in the House of Representatives including 165 members elected under the first-past-the-post category or direct election and 110 under proportional representation basis.
The CPN-UML has 121 members, Nepali Congress has 63, and CPN-MC has 53 while Federal Socialist Forum Nepal has 17 and Rastriya Janata Party Nepal has 16 members.
The ethnic Madhesi group, mostly of Indian-origin, protested for months, saying they were not getting enough territory in one of the states and were also facing discrimination.
Violent clashes not only killed 50 people, but also left the country with severe shortages of fuel and medicine because protesters blocked the borders with India.
The protesters finally agreed to the elections after some amendments were made to the Constitution.