Macedonia's four largest political parties have reached a deal that will see prime minister Nikola Gruevski resign and is hoped to ease tensions in the former Yugoslav republic.

The agreement was brokered by EU enlargement commissioner Johannes Hahn, three MEPs, and the EU and US ambassadors to Skopje.

Student or retired? Then this plan is for you.

The EU commission announced the deal on Wednesday morning (15 July).

Under the deal, Gruevski's government “will submit its formal resignation to parliament in due time to enable the new government to be sworn in on 15 January 2016”.

His party will nominate a new prime minister to lead the transitional government, whose tasks “shall be limited to the organisation of the early parliamentary elections”, to be held 24 April 2016.

The political crisis began in February when opposition party SDSM released wiretaps that showed corruption in Gruevski's ruling party.

In May, the political crisis turned violent when 14 ethnic Albanians and eight policemen died during a police raid.

The violence triggered EU member Bulgaria to send soldiers to its border with Macedonia as a cautionary measure.

In June, politicians reached an EU-brokered agreement, but some details, such as the future role of Gruevski, were left to discussion.

These details have now been addressed.

Among them is also that SDSM will return to Macedonia's parliament, which it had boycotted, on 1 September.

The opposition party will also nominate several (deputy) ministers, to be appointed on 20 October, who will stay on in the transitional government.

The deal also established a special prosecutor who will investigate “the interception of communications”. This investigator will start by 15 September.

In a social media message, commissioner Hahn said the agreement “keeps the door open [to Macedonia] for the Euro-Atlantic perspective”, i.e. the possibility of an EU and/or Nato membership.