North Macedonia's embattled Prime Minister Zoran Zaev said on Sunday that he was resigning following his party's poor showing in municipal elections over the weekend.

The shock announcement follows months of sliding popularity for the prime minister as he struggled to keep the country's economy on track amid the pandemic's headwinds and talks over possible accession to the European Union all but stalled.

"I take the responsibility for the results of these elections. I resign as prime minister," Zaev said during a press conference.

"I have brought freedom and democracy, and democracy means taking responsibility," he said.

The premier offered few details or a timeline of when he would resign -- a move that must be approved by parliament. Zaev said he also opposed a new round of elections following his resignation.

The main opposition party VMRO-DPMNE, which scored big wins in the weekend's elections, including in the capital Skopje, appeared to call for a new round of parliamentary polls after the announcement.

"The government has been de-legitimised and that is the new reality that will be manifested in the parliament over time. However, it's best if this happens through early parliamentary elections," said opposition leader Hristijan Mickoski.

Zaev was elected prime minister in 2017 after 10 years of right-wing rule led by strongman Nikola Gruevski whose government was shaken by a huge wiretapping scandal revealed by Zaev himself.

In 2018, Zaev struck a tough deal with Athens to add the geographical qualifier "North" to the country's official name in order to distinguish it from the Greek province of Macedonia.

North Macedonia's Prime Minister Zoran Zaev said he would resign after his party's poor showing in municipal elections
North Macedonia's Prime Minister Zoran Zaev said he would resign after his party's poor showing in municipal elections AFP / Nikolay DOYCHINOV

The name change was a precondition to paving the way for possible EU membership.

However, the country has since faced threats from Bulgaria to block the beginning of talks due to a separate spat -- with Sofia disputing the origin of the Macedonian language, calling it a Bulgarian dialect.

Both countries also lay claim to certain historical events and figures, mainly from the Ottoman era.

Zaev had pledged to make progress on the EU accession talks after the country officially became a candidate for membership but has had little to show for it in recent months.

North Macedonia held parliamentary elections in 2020 that saw Zaev's Social Democrats return to power, after his party narrowly won a victory over right-wing rivals.

His governing coalition, a tie-up with the largest party representing the ethnic Albanian minority, continues to hold a wafer-thin majority in the parliament.

Zaev hails from the eastern city of Strumica, where his family is one of the country's top producers of ajvar -- a red pepper relish beloved in the Balkans.

He entered politics in 2003, eventually becoming a three-term mayor of his hometown and then leader of the Social Democrats in 2013.