SKOPJE (Reuters) - Former Macedonian prime minister Nikola Gruevski, head of the opposition rightist VMRO-DPMNE party, resigned on Monday following an election defeat last year and unrest that rocked the small Balkan country in April. Gruevski, 47, led the ex-Yugoslav republic for almost a decade, and his party bloc since 2003, until January 2016 when a wiretapping scandal brought down the ruling VMRO-DPMNE bloc. A snap election in December 2016 ended inconclusively and a long parliamentary stalemate ensued, ending in May when Social Democrat Zoran Zaev formed a coalition with ethnic Albanian parties that represent a third of the 2 million population. VMRO-DPMNE said its Central Committee had scheduled a leadership congress for Dec. 22-23 after Gruevski s  irrevocable resignation.  Gruevski said that ... his resignation was a moral act, as it is natural that the person in whom everyone had confidence should take the responsibility for the (electoral) defeat,  a party statement said. In April, protesters including VMRO-DPMNE supporters  stormed parliament and assaulted Zaev as Social Democrats and its ethnic Albanian allies elected an ethnic Albanian as parliament speaker. Dozens were injured in riots. The VMRO-DPMNE suffered a further setback last month when police arrested Mitko Cavkov, a former interior minister, and a number of its lawmakers and activists on charges related to the disturbances in April. The April unrest marked the worst crisis in Macedonia since 2001 when Western diplomats narrowly averted a full-scale civil war arising from an ethnic Albanian insurgency, promising Skopje a pathway to membership of the European Union and NATO. Macedonia, which won independence in 1991 from then-federal Yugoslavia in 1991, has made little progress towards EU and NATO membership due to a name dispute with Greece. 