It arrived three weeks later than the Mayans predicted, but for Pakistan, the last week has seemed like the apocalypse. On January 10, following the country's worst-ever sectarian attack, which killed 92 Shias in Baluchistan, protestors nation wide organized sit-ins to demand a greater security presence in the province and a dissolution of the provincial government, which had dragged its feet on curbing violence despite the deaths of some 100 Shia in 2012. Several days later, on the 14th, Islamabad met both of those demands but refused to take action against the extremist group Lashkar-e-Jhangvi group, which claimed responsibility for the attack.

The following day started with an early-morning scuffle between protesters and the police in Islamabad, leaving eight injured. Just as things seemed to calm down, thousands began to gather for an afternoon rally in which the country's latest self-appointed savior -- the Canadian-Pakistani cleric Muhammed Tahir ul-Qadri -- promised to unveil his manifesto. Capitalizing on the still-tense situation, Qadri descended on the capital with a convoy of thousands. Police were on alert, and a bulletproof box awaited the speaker.

In his oration, Qadri demanded the dissolution of the entire Pakistani parliament and all its provincial assemblies, the announcement of a new caretaker government, and the introduction of electoral reforms, including the creation of an independent election commission that would ensure free and fair elections. In a terrifying display of his strength, Qadri ordered his followers to push aside barriers surrounding D-Chowk, the square in front of the parliament, and set up camp in what he designated "Pakistan's Tahrir Square." As Pakistanis held their breath for his next move, the Supreme Court struck.

As part of a seemingly endless corruption case that had been percolating through the court since last March, the court ordered Pakistan's National Accountability Bureau (NAB) to arrest any politician who had been implicated. This included Prime Minister Raja Pervez Ashraf, who had been Pakistan's water and power minister when the cases were first brought to the court's attention. Although he had been questioned by NAB and was found to be uninvolved, he was still a person of interest and, more than that, was reviled nationwide for his role in an energy crisis that has crippled the country in recent years. All that was enough for the court to demand that the NAB chairman issue a warrant for his arrest as well.

Back in D-Chowk, Qadri took the opportunity to announce to a joyous audience that the Supreme Court had met one of his key demands. Cheering crowds in Islamabad readied themselves for a bigger battle, pledging to stay in place until the rest of their claims were met. In response, the benchmark Karachi Stock Exchange 100 index fell by more than 500 points between 2:25 and 2:40 that afternoon and trading ground to a halt. Supporters of the government in Sindh province, where the exchange is located, took to the streets in their own protests, demanding that the Supreme Court rescind its orders.

Reactions across the country have ranged from apathy -- the sense that these events will prove a mild hiccup with no long term effect on the country -- to panic -- that this will be a catastrophe that could kill the still-fledgling Pakistani democracy.

What explains this sudden implosion? A majority of the political class seems to agree that Qadri is not acting on his own but is funded by Pakistan's Inter-Services Intelligence (ISI), which hopes to send the civilian government into crisis. Qadri, the founder of the Minhaj-ul-Quran Trust International, is a renowned moderate Muslim scholar and served as a member of Pakistan's National Assembly in 1990. In the past two months, he has spent billions of rupees on his campaign for electoral reform, including on a massive media blitz. In Pakistan, such unexplained windfalls are usually thought to be related to the ISI.

The Supreme Court's entrance into the fray, meanwhile, has raised questions of whether the military and the judiciary are in cahoots. That too, has its precedents in Pakistani history. The judiciary has in the past used its power to constitutionally legitimize military coups. In 1979, it even sentenced to death one deposed prime minister, Zulfikar Ali Bhutto, at the request of a new military dictator, General Muhammed Zia-ul-Haq. And the judiciary today has its own axe to grind with the federal government. The tension stems from a personal enmity between the chief justice, Iftikhar Chaudhry, and President Asif Ali Zardari. If the judiciary and the military were allied during against the civilian government during this week's confusion, they might be planning to appoint a technocratic caretaker government, sidelining Pakistan's democratically elected politicians.

In truth, though, it is unlikely that the judges and the generals are acting together. As irksome as the Supreme Court has been for the civilians, it has also been less than kind to the army in the past two years. It has heard contentious cases involving missing persons -- people detained by intelligence agencies without due process -- and forced the military to acknowledge its past human rights abuses. Chaudhry has also demanded more oversight over the military and has publically denounced military coups and pledged to ensure that the democratic process continues unimpeded.

Nevertheless, the timing of the court's ruling was too serendipitous for it to be entirely unrelated to the Qadri rally. It is likely that the Supreme Court seized on the distraction of his rally to clear the decks of politicians it dislikes before upcoming elections.

Moreover, although the last few hours have surely tested the civilian government's resilience, it is not necessarily doomed. Qadri, for all his bluster, will not be able to easily sustain the passion of the thousands who have come out to protest with him. If the government does not give into their demands quickly, many could start to return from the winter chill to their homes.

The judicial activism, too, is nothing the civilian government couldn't overcome. In fact, the ruling Pakistan Peoples Party (PPP) already lost one prime minister to the highest court last year, when Yousaf Raza Gilani refused the court's order to write a letter to Swiss authorities asking that graft cases against Zardari be reopened. The judges retroactively disqualified him from standing for office and booted him in April.

At this point, the PPP could merely install another prime minister for the two-odd months left before general elections are held this spring. That move would allow the current government to somewhat appease the protesters and become the first democratically elected government in Pakistan's history to ever complete its five-year term. Alternatively, the party could forgo that option and dissolve all the assemblies, forming a caretaker government ahead of the elections. This would satisfy both the protesters and the opposition parties, who have been demanding fresh elections for over a year now.

The second option would be ideal for Qadri, who could claim that all his wishes were granted. Although he says that he does not wish to stand for any political office, it would not be surprising to see him emerge with some leadership role. The second option would benefit another powerful player, too: Imran Khan, the popular cricketer turned politician who has been busy amassing support for his own run in the elections this spring. A few hours after the court ruling, he forwarded his own demands to the government. Among the seven were the dissolution of the government, the immediate announcement of elections, and the removal of Zardari as president. The government's failure to comply, he threatened, would force his party, Pakistan Tehreek-e-Insaf, to take to the streets, possibly joining Qadri. By hitching his wagon to Qadri's, Khan could pull back some of the support he has lost in the past few months due to misleading statements and alliances with corrupt politicians.

Throughout the storm, the PPP has been valiantly trying to downplay both the sit-ins and the impending arrest of Ashraf. Claiming that Qadri is a spoiler sent by the intelligence services to destabilize Pakistan and that Ashraf was never specifically named in the ruling (which is not true), the government is hoping to restore some measure of calm. That is unlikely, but Pakistan is never calm, and it plugs ahead nonetheless.