KATHMANDU (Reuters) -Nepal is set for a new coalition government led by politician K.P. Sharma Oli after the more radical Prime Minister Pushpa Kamal Dahal lost a parliamentary vote of confidence on Friday, ending a tumultuous 20-month tenure.

Nepal has been politically unstable since it abolished a 239-year-old monarchy in 2008. Oli's new government will be the 14th since then.

Its politics are closely monitored by its two big neighbours China and India, who have invested heavily in the Himalayan country as they jostle for influence.

Dahal, 69, was forced to either resign or prove his majority in parliament after his largest ally, the liberal Communist Unified Marxist Leninist (UML) party, led by Oli, withdrew support last week.

Oli, who has been prime minister twice before, struck a deal with the centrist Nepali Congress (NC) at the end of June, securing enough seats for a majority, meaning he is poised to govern, but no date has been set for the new government to take office.

Dahal, a former Maoist rebel chief, needed at least 138 votes in his favour in the 275-member house to retain power. A total of 63 of the 258 lawmakers present in the chambers voted for him, 194 voted against, and one abstained.

"The confidence vote sought by Prime Minister Pushpa Kamal Dahal has been rejected," Parliament Speaker Dev Raj Ghimire declared after the ballots were counted.

In his third term as prime minister, which began in December 2022, Dahal changed his main coalition partner three times and had to seek a vote of confidence five times, including the one he lost on Friday.

"The new coalition was necessitated by a need for political stability," UML lawmaker Yogesh Bhattarai said.

In a speech ahead of Friday's vote, Dahal said Oli's coalition of the two biggest political parties was against democratic practice.

UML is the largest party in parliament and NC is the second largest.

"I am concerned this might lead to regression and authoritarianism," said Dahal, whose Communist Party of Nepal (Maoist Center) is the third largest party.

(Reporting by Kathmandu Newsroom; Additional reporting by Ainnie Arif; Writing by Sakshi Dayal; Editing by YP Rajesh and Barbara Lewis)