KATHMANDU (Reuters) - Maoist Nepali Prime Minister Prachanda resigned on Wednesday, barely nine months after coming to power, creating a leadership vacuum weeks before the second round of local elections, the first to be held in more than two decades.

Nepalese Prime Minister Pushpa Kamal Dahal, also known as Prachanda, arrives at the parliament in Kathmandu, Nepal May 23, 2017. REUTERS/Navesh Chitrakar

Prachanda’s exit, which had been expected under a power-sharing deal with the Nepali Congress party, could disrupt the schedule for the final phase of municipal and village assembly polls set for June 14.

Wearing a bowl-shaped Nepali cap, Prachanda, 62, a former rebel commander, announced his resignation in a televised address to the nation after the opposition Communist UML party threatened to block his speech in parliament, saying the government had created some local and municipal bodies without due legal process.

Prachanda’s final month in office was hit by a clash between his government and the chief of the Supreme Court over the appointment of a new police chief.

“I have decided to fulfill the commitment made to the Nepali Congress when I became prime minister,” Prachanda said, reading from a prepared statement. “I am going to the president to tender my resignation right now.”

A new government, which would be the 25th in the past 27 years, will be responsible for completing the remaining phase of the local polls - a precursor to national elections due to be held by the end of the year.

But the choice of a new leader could take several days as politicians are required to spend a week to agree on a consensus candidate - a highly unlikely scenario - before lawmakers are asked to elect a successor in a parliament where no party commands an absolute majority.

“The resignation creates confusion about the polls because the focus will now be more on government making than elections,” said Guna Raj Luintel, editor of the Nagarik daily.

Sher Bahadur Deuba, 70, the chief of the Nepali Congress, is favorite to replace Prachanda, who will stay on as caretaker prime minister until a new leader is picked.

Nepal is recovering from devastating earthquakes two years ago in which 9,000 people were killed. The Himalayan nation has been plagued by wrangling over a new constitution approved in 2015 as minority ethnic Madhesis protested that they had been deprived of their say.