K.P. Sharma Oli has been picked to become the new prime minister of Nepal after leading an alliance of two communist parties to a sweeping victory in recent parliamentary elections.

A spokesman for the president's office says Oli was named to form a new government after the results of last November and December's elections were made official late Wednesday night. The results led Prime Minister Sher Bahadur Deuba to resign earlier Thursday after just eight months in office.

The 65-year-old Oli served as prime minister from 2015 to 2016, a few years after Nepal's transition in 2007-2008 from a monarchy to a federal republic. During his tenure, protests over the constitution led to a crippling blockade of the India-Nepal border by New Delhi, which pushed Nepal towards closer diplomatic relations with neighboring China.

The landlocked, impoverished Himalayan nation has been gripped by political instability since the establishment of an elected parliament in 1990, including a decade-long Maoist insurgency and the abolishment of the monarchy in 2008.