KP Oli from Communist Party of Nepal was sworn in on Thursday as country's 41st prime minister.

Khadga Prasad Sharma Oli from the Communist Party of Nepal (Unified Marxist-Leninist) has been sworn in as the 41st prime minister of Nepal, formally concluding the long-delayed democratic transition.

President Bidya Devi Bhandari administered the oath of office at Sheetal Niwas at 4:30pm on Thursday in the capital, Kathmandu, hours after she appointed Oli to the post.

KP Oli, as he is popularly known, succeeds the Nepali Congress Party's Sher Bahadur Deuba, who resigned nearly two months after an alliance of communist parties swept the parliamentary and provincial elections.

A surprise alliance of Maoist former fighters and the CPN (UML) registered a surprise victory in December.

This will be Oli's second stint as prime minister. He previously held the top executive post from October 2015 to August 2016.

Born in the hills in eastern Nepal on February 22, 1952, Oli was educated in the plains of Jhapa in eastern Nepal, where he became influenced by local communist leaders as a teenager.

In 1970, Oli became a member of the Nepal Communist Party and began an underground life, as the erstwhile royal regime cracked down on communists.

Oli spent 14 years in jail during autocratic monarchy for his involvement with radical communist politics, but has veered to the right in the last two decades.

The secondary school dropout won elections to parliament in 1991, 1999, 2008 and 2013. He served as home minister in 1994 and foreign minister in 2007.