A former rebel chief became prime minister for a third time in a country long racked by political instability.The former leader of a decade-long Maoist rebellion was elected prime minister by Nepal’s Parliament on Monday, a move that kept the old guard in power despite growing calls for change and was welcomed in China as it competes for influence in the Himalayan nation.The former rebellion leader, Pushpa Kamal Dahal, 68, emerged as the country’s top leader for the third time in 14 years after weeks of negotiations that followed an inconclusive November election and unexpectedly brought the country’s two main communist parties closer together.In Nepal’s musical-chair electoral system, Mr. Dahal will succeed Sher Bahadur Deuba, 76, who had hoped to secure a sixth term as prime minister. The principal bloc supporting Mr. Dahal was led by the Communist Party of Nepal (Unified Marxist-Leninist), chaired by another former prime minister, K.P. Sharma Oli, who himself had been seeking a fourth term.Many Nepali voters reacted to Mr. Dahal’s swearing-in on Monday with a note of despair.“No excitement. He was already elected prime minister twice but did nothing for us,” said Saroj Basnet, 45, a businessman from Lalitpur, near the capital, Kathmandu. What little hope he found in the election, Mr. Basnet said, came “from new faces who are joining government as ministers.”Mr. Dahal’s victory represented a continuation of the establishment in an election that drew an unusual number of young and first-time candidates clamoring for a fresh direction in one of Asia’s poorest nations.It was also greeted warmly in China, which has made increasing inroads in Nepali politics through infrastructure development financing and aid as neighboring India struggles to keep the country firmly within its own sphere of influence.Mr. Dahal, the head of another communist party, the Communist Party of Nepal (Maoist Center), first became prime minister in 2008, after abandoning a decade-long insurgency that claimed the lives of 17,000 people.The armed rebellion succeeded in overthrowing the centuries-old Hindu monarchy and establishing a democratic republic, which Mr. Dahal and his supporters said would pave a path to economic prosperity for Nepal.But as the country has struggled to find political stability, churning through 13 governments in 14 years, Nepal has failed to develop at an adequate pace for a largely young population that is concentrated in Kathmandu but also spread across a remote, mountainous landscape. No government since 2008 has managed to complete a full term.With high unemployment and little job creation, the country’s economy depends on remittances from citizens working abroad. Every year, about 600,000 young people in the country of 30 million leave for the Persian Gulf and Malaysia in search of work.Young Nepalis with members of their families in Kathmandu in April as they prepared to go abroad for employment or university courses.Saumya Khandelwal for The New York TimesInspired by some independent candidates’ success in Kathmandu and other cities in recent local elections, about 860 independent candidates ran for 275 seats in Parliament in November, according to Nepal’s Election Commission. More than 1,000 candidates ran in provincial assembly elections for 330 seats.The huge field of candidates signaled a strong desire to replace the political establishment with new blood. More than half of Nepal’s eligible voters are ages 18 to 40. A spirited social media campaign to upset the old guard was organized on Twitter with the hashtag #NoNotAgain.A group of young professionals and political novices formed a party, naming Rabi Lamichhane, a television news anchor, as its chair. Their party secured 20 seats, but it was unclear whether they could dent the mainstream political order.With limited options, the new party backed Mr. Dahal and was rewarded. Several members were chosen for ministerial posts, with Mr. Lamichhane himself appointed deputy prime minister and home minister.In an unforeseen turn, the wrangling that followed the election brought the two communist leaders, Mr. Dahal and Mr. Oli, closer together. Mr. Deuba had withdrawn from a deal to run the government on a rotational basis with Mr. Dahal, who then approached Mr. Oli to strike a deal of their own. Under the published terms of their power-sharing arrangement, the two men will take turns as premier.Top Chinese leaders had visited Kathmandu advising unity among the country’s communist parties after the government led by Mr. Deuba’s centrist social-democratic party signaled that it would accept $500 million in U.S. aid.After Mr. Dahal’s victory, congratulatory messages poured in from all three foreign power centers — India, China and the United States.A Chinese Foreign Ministry spokeswoman said that China viewed its relations with Nepal with great importance and would deepen cooperation with the Dahal government on infrastructure projects under Beijing’s Belt and Road Initiative. An official in Mr. Dahal’s party told Reuters that the new government would seek “relationships of equi-proximity” with both China and India.The Indian prime minister, Narendra Modi, was quick to express his willingness to work with Mr. Dahal. “The unique relationship between India & Nepal is based on deep cultural connect & warm people-to-people ties. I look forward to working together with you to further strengthen this friendship,” he wrote on Twitter.Relations between India and Nepal were strained during Mr. Oli’s last term in office, which ended in 2021, after the government released a map claiming that about 150 square miles within India were rightfully Nepal’s. The tensions eased after Mr. Oli left the government and Mr. Deuba came to power.Emily Schmall More