A small Balkan country is in state of crisis. In Macedonia, things are getting serious. If the country descends further in chaos – and events are rapidly moving in that direction – then not only is its future as a functioning democracy in jeopardy but the very integrity of the state is at risk.

In one sense, crisis is the norm in Macedonia. Since emerging from the wreckage of Yugoslavia in the early 1990s, the country has struggled to establish itself as a viable state in a difficult region of the world. Neighbouring Greece has rejected Macedonia’s right to use its constitutional name; Bulgaria has disputed its claims to a separate national identity; and Serbia has denied Macedonia’s right to an autocephalous church.

Even worse, Macedonia is sharply divided between its majority Slav-population, known as Macedonians, and a large Albanian minority, which forms around a quarter of the population. In 2001, two years after the Albanians of neighbouring Kosovo succeeded in detaching themselves from Serbia, Macedonia’s Albanians launched their own insurgency. Alarmed at the consequences for regional stability, the West rapidly intervened and imposed a deal in which Albanians gave up any plans for separation in return for greater political rights.

Macedonia: At least 12 police officers injured in shootout with 70 armed people

Since then, Macedonia has been largely forgotten by the West. Formally, the country is a candidate for membership of the EU but its path has been blocked by Greece, and Bulgaria blows hot and cold. The same goes for its membership of NATO. As a result, a poor country with weak institutions, no tradition of democracy or markets and a legacy of ethnic resentment has been left to fend for itself in an increasingly dangerous world.

Despite its manifold challenges, Macedonia appeared to be making progress for much of the last decade. The Internal Macedonian Revolutionary Organisation (VMRO), led by a young reformer, Nikola Gruevski, won power from the former communists and embarked on a radical overhaul of the investment environment, generating impressive levels of economic growth. Meanwhile, the former leaders of the Albanian rebellion, subsequently a political party called the Democratic Union for Integration (DUI), took up position in a coalition with VMRO, ensuring broad political stability.

But behind this positive façade, Macedonia’s traditional patronage-based system, which subordinates the rule of law to raw political power, remained unchanged. This became graphically clear in February last year when the leader of the political opposition, Zoran Zaev, announced he had thousands of wiretapped telephone conversations in his possession which revealed corruption, electoral fraud and outright criminality at the most senior levels of government.

Macedonia demonstrations: Thousands protest for a fifth night

The evidence suggests that the wiretaps were made by the local intelligence services in a massive spying operation, led by Gruevski, who wanted to know exactly was going on in the country – in the opposition, in business circles and in his own cabinet. Not only did this help him maintain power but it also gave him a competitive edge in his myriad business dealings. Eventually, a whistle blower within the intelligence service decided enough was enough and passed the recordings to the political opposition.

In the weeks that followed, Zaev began to release the recordings in a series of high-profile press conferences, all the while demanding that the government cede power. Gruevski’s initial response was to claim the tapes had been fabricated and, somewhat contradictorily, to accuse Zaev of treachery and collusion with a foreign intelligence service, which was plotting to overthrow the government and destabilise Macedonia.

As pressure on Gruevski mounted, he then apparently colluded with his Albanian coalition partners to manufacture a security incident in the border town of Kumanovo which pitched a group of ethnic-Albanian paramilitaries, many from Kosovo, against the Macedonian police. In the ensuing shoot out, nineteen people were killed.

While the aim was to distract public attention from the deepening corruption scandal, the opposite occurred, as thousands took to the streets demanding the resignation of the government – not just Macedonians, but also ethnic Albanians who castigated their leaders for a betrayal of their national struggle for dignity and rights.

When some of these protests turned violent, an increasingly worried EU finally re-engaged with Macedonia to broker a deal between the government and opposition. The result was the Pržino Agreement, signed in July last year, which set out a roadmap for ending the crisis.

The key provision was early elections, initially scheduled for April this year. Ahead of these, the government agreed to form a transitional administration which included the political opposition, and Gruevski to step down as prime minister. The government also agreed to clean up Macedonia’s electoral lists, which contain thousands of phantom VMRO and DUI supporters, and give the opposition equitable access to the state-owned media.

In parallel, the EU demanded the appointment of an independent Special Prosecutor to investigate the evidence contained in the leaked recordings.

Pržino bought a few months’ respite but little genuine progress. First, the government failed to amend the electoral lists and open up the media, leading to a postponement of the elections, to June. Then it broke off contact with the EU’s ineffectual mediator on the ground. In response, Zaev and the rest of the opposition announced a boycott of the elections, claiming the government’s obstructionism made a fair contest impossible.

With the ball in the government’s court, the president of Macedonia, widely seen as a stooge of the government, last month used his authority to pardon to all those under investigation by the Special Prosecutor, shortcutting her attempts to enforce the rule of law. Once again, an enraged populace returned to the streets, demanding the resignation of the government and the president in what is now being called the Colourful Revolution. Meanwhile, sensing the direction of events, DUI announced that it too would be joining the opposition’s boycott of the ballot.

With Macedonia heading for elections with just one party in contention, European diplomats intensified their pressure on the country. The EU warned it would not recognise a government elected after a flawed ballot. And, Germany, Macedonia’s main trading partner, dispatched its own mediator to put pressure on the locals, starting with a halt to the sham elections.

These efforts appeared to pay off. After discussions with the German mediator, DUI used its authority to petition Macedonia’s Constitutional Court to annul the elections. Last week, the Court ruled that multiparty elections with just a single party would indeed be unconstitutional, and cancelled the ballot.

So far, so good. But what happens next is very much an open question.

In a best-case scenario, VMRO would bow to popular and international pressure and cede control to a technocratic administration that created the conditions for free and fair elections later this year. For his part, the president would also withdraw his pardons and allow proper judicial process to proceed. Following the transition to a post-Gruevski government, and the arrival of new political figures, the EU and the US would demand that Greece lifted its 25-year blockade and set Macedonia on a course of westward integration.

However, matters may not turn out so well. For one thing, Gruevski is unlikely to give up power voluntarily, especially since he now has momentum. While the suspension of the elections is superficially a victory for the constitution, it actually leaves VMRO in power and free of an immediate electoral challenge.

Even better, following a vote in parliament this week, VMRO and DUI have used their majority to expel the remaining opposition ministers from government, effectively terminating the interim administration and restoring the old coalition. Going forward, Gruevski can rely on a caucus of supporters, who depend on the party’s survival for their jobs and livelihoods, to take to the streets and face down the opposition protestors.

In short, all he needs to do to achieve his goals is to maintain the status quo.

Potentially, the EU will escalate pressure on Gruevski. In the last few weeks, some Europeans have threatened to sanction VMRO in a bid to force compliance with the terms of Pržino. But it’s not clear there would be consent for this among the Central Europeans, who need Macedonia onside to enforce the closure of the Balkan migration route.

And even if the EU did sanction the government, the effect might simply be to push it into a closer relationship with Russia, which would delight at the opportunity to extend its influence in the strategic battleground of the Balkans.

All this creates unprecedented opportunity for the DUI and the Albanians. As matters stand, VMRO remains in power and the coalition intact, but only thanks to DUI’s petitioning of the constitutional court and the subsequent suspension of elections.

Now DUI has said it wants something in return, and that something is very likely to be the federalisation of Macedonia. Not only has this emerged as the key demand of ethnic Albanians who want to secure their rights; but delivering this goal could help revive DUI’s flagging popularity.

This risks transforming what has hitherto been a crisis of governance into a crisis of state. The Albanians will try to negotiate federalisation with VMRO on pain of withdrawing from the government, undermining its parliamentary majority and expediting new elections. But if VMRO refuses to concede this demand because of a backlash from Macedonian nationalists, then DUI could leave the government anyway, bringing an end to ethnic power sharing and creating a de facto split in the country along ethnic lines.

Worryingly, events in Macedonia are playing out at a time when neighbouring Kosovo is in a state of profound political turmoil following an EU-brokered deal last year that similarly partitions the country along ethnic lines. With Albanians on two sides of a porous border both negotiating issues of territory and governance, only an optimist would gamble on the two scenarios not joining up.

The way out of this crisis is not at all clear, and matters are set to get worse before they get better. The hope must be that it’s not yet too late to stop Macedonia completely spiralling out of control.