Pakistan is facing one of the most serious political crises in its modern history. After eight days of tense military stand-off in the capital between the army and several hundred militant students from a religious seminary, the Pakistani capital awoke just after dawn on Tuesday to a series of thunderous explosions in the heart of the city. By late afternoon, columns of smoke and ash were hovering in the air and dozens of militants and government troops lay dead or wounded. Pictures of the battle were flashed around the world as Washington and London's critical ally in the war on terror saw its capital turned into a war zone, in scenes unimaginable in the 60 years since the creation of Pakistan.
In the past week a quiet, tree-lined district made up of large, comfortable family villas and private schools has been transformed into a battlefield. Tanks, armoured personnel carriers, hundreds of metres of barbed wire and thousands of Pakistani special forces and paramilitary units of the army have cordoned off the area. At the epicentre of this no-go zone, where a strict curfew has been imposed and the residents forced either to leave or remain indoors, is the so-called Red Mosque ("Lal Masjid") and the all-female madrasa attached to it, the Jamia Hafsa.
The Red Mosque is the oldest mosque in the city, and was established shortly after Pakistan's capital was moved from Karachi to the purpose-built city of Islamabad. Its founder was Maulana Abdullah Ghazi. He was renowned for his Friday sermons on the need for Muslims to wage jihad in Afghanistan against the Soviet Union. As such, he was patronised and favoured by Washington's chief ally and link to the Afghan mu jahedin, the military ruler General Zia ul-Haq. Like Pakistan's military and intelligence agencies, Maulana Abdullah did not dispense with his links with the militant Islamist groups and ideologies that grew up around the Afghan mujahedin after the Soviets were driven out. Clerics like him were funded, encouraged and often guided by the Pakistani military and intelligence agencies throughout the 1990s. Their links with jihadist groups through the mosques and religious seminaries they ran were essential to Pakistan's regional policy (whether in opposing India in Kashmir or maintaining influence in Afghanistan).
But the jihadist movement's increasing strength and influence steadily and inevitably outgrew the tight leash imposed on it by its creators and sponsors in the Pakistani state. The founding of al-Qaeda by Osama Bin Laden, himself an early Arab volunteer in the mujahedin war in Afghanistan, was just one example of this. In 1998, Maulana Abdullah met Bin Laden and promised the al-Qaeda leader to "continue his work inside Pakistan". Maulana Abdullah took his younger son along to the meeting with Bin Laden; that son, Maulana Abdul Rashid Ghazi, was the man leading the 200 or so militant students who have been holed up inside the Red Mosque, besieged by the Pakistani military in the heart of Islamabad. He was killed during the ensuing fighting.
The crisis over the Red Mosque began six months ago. Yet General Pervez Musharraf did nothing about it, to the consternation of Pakistan's middle class, which was growing ever more fearful of the madrasa's brazen confrontation with the Pakistani state and of its ambition, in the words of Maulana Abdul Rashid Ghazi, "to destroy the failed political system in Pakistan which has betrayed the majority of the country's poor and establish a sharia state instead".
What the militant students and leaders of the Red Mosque wanted to do was create a model for Pakistan's estimated 20,000 madrasas to follow. It was the simple but tested and highly effective Islamist model of setting up parallel social and welfare institutions, aimed at highlighting how the state had failed the majority of ordinary people. It has worked for Hamas in Palestine, Hezbollah in Lebanon and many others.
The madrasas offer the millions of desperately impoverished rural families a chance to send their children to cities and towns, where they will be given an education and a place to live in what the families see as a morally and socially conservative environment. They will be fed regularly, thus reducing the pressure on what is already a subsistence existence. It is a role that the Pakistani state has struggled to match, with one of the lowest comparative expenditures on education in the world. The education that the madrasas offer is, of course, strictly religious, but the Red Mosque's ideological links with jihadist groups inevitably exposed the students to far more than just spiritual instruction. The militants of the Red Mosque extended their model beyond the walls of their madrasas and out on to the streets of Islamabad. The female members of the madrasas led vigilante operations. They kidnapped brothel owners, harassed sex industry workers, threatened music shops and even policemen. They did so aggressively, taunting the authorities to stop them.
Fearful of a nationwide showdown with the thousands of madrasas and their militant students and leaders, and after decades in which the seminaries had been an effective tool for the Pakistani state in domestic and regional policy, President Musharraf's government failed to respond to such challenges to its authority.
While domestic considerations deterred him from confronting the students and leaders of the Red Mosque, international pressure from key allies was pushing him in the opposite direction. A turning point came when a group of Chinese women working at a massage parlour was held hostage by female students from the mosque. Beijing, with considerable commercial interests in Pakistan, was alarmed that its citizens could be taken off the streets of the Pakistani capital and paraded in front of the international media while the government did nothing. Beijing wanted to know if it had a stable ally in Pakistan. It was at this moment that Musharraf decided to take action and the confrontation with the militants at the Red Mosque started, at the beginning of the month.
Yet there is much more at stake in this crisis than the immediate battle. At its heart, it is about the Pakistani state cutting the cord and confronting the jihadist groups and ideologies it has given rise to. The prominent Pakistani journalist Zahid Hussain has described this as "a battle for the soul of Pakistan" - a struggle to establish what kind of country it wants to be, six decades after it was founded following the Partition of India.
None the less, the bloody end to the siege on 10 July will have a fearful and profound impact on Pakistan in the coming months. It will have made "martyrs" of the students and leaders killed in the operation and thereby ensured that Musharraf will become a mortal enemy for many militant madrasa leaders and their followers in the country.
How civilian politicians in Washington and Pakistan respond will be critical. Both have had their frustrations and differences with Musharraf and with Pakistan's armed forces. But Washington's and Pakistan's main civilian political parties are solidly behind him in Pakistan's emerging divide.
The violent end of the Red Mosque in Islamabad marks the beginning of a critical shift in the politics of Pakistan. The decades-long alliance between the Pakistani state and the jihadist movements that it supported has begun to be broken. It is a point from which it will be hard to return. It is indeed the start of the long battle for Pakistan's soul.