It was December, 2007, and General Pervez Musharraf had declared a state of emergency in Pakistan. He suspended the Constitution, banned all independent television channels, and sacked the country’s senior judiciary. The streets were thronged with protestors raising their fists and chanting, “Go, Musharraf, go!”

In London I took part in a protest outside the Pakistani High Commission. It was a smallish demonstration, mainly comprising Pakistani undergraduates at the University of London. We chanted slogans against the General and called for a return to the rule of law. Then a student in a beanie took the microphone and sang a poem. Written by Faiz, the great Pakistani poet who spent four years in jail under General Ayub Khan’s martial law, the poem, “Hum Dekhain Gay”—“We Shall See,” has become an anthem of resistance for the people of Pakistan. As I stood on that chilly pavement and listened to the young man’s full-throated voice, I was filled with profound sadness. More than twenty-five years ago, I had sung this very song on the streets of Lahore. I, too, was an impassioned student then, and I, too, had protested the tyranny of a military dictator. I, too, had believed that that would be the last martial law we would experience.

Though outraged by General Musharraf’s strong-arm tactics, Pakistanis were not despondent. The economy was strong and foreign investors looked favorably upon Pakistan as an emerging market. A national election was in the offing, and Benazir Bhutto, emerging from years of exile the leader of Pakistan’s largest and most popular political party, had returned to contest it. Though religious extremists had dug into the Tribal Areas in the north, Benazir vowed to flush them out and, with American backing, end their reign of terror. Relations with India were calmer and more open than even before. There was everything to play for.

Today that optimism has vanished. A civilian government replaced Musharraf, but Pakistan faces economic collapse: rampant inflation, unbridled capital flight, and a nose-diving rupee. Benazir Bhutto is dead, killed by the very militants she had pledged to eradicate. Islamist insurgents have annexed chunks of Pakistani territory abutting Afghanistan. A bitter civil war has made refugees of 200,000 civilians. The army, fighting its own people, is demoralised and divided. The same Pakistanis who were agitating on the streets last November are afraid to step out today; roadside and suicide bombs have killed and maimed thousands in the last year. Pakistan has reached a tipping point. How and why did it unravel so fast?

Pakistan’s problems are not new. Established in 1947 as a homeland for the Muslims of the Subcontinent, its Islamic and secular identities have been in conflict ever since. In Pakistan’s sixty-year history, a corrupt, self-serving ruling class of land owners; a crooked bureaucracy; a boom-and-bust economy; long-simmering tensions with India over Kashmir; and a huge, powerful army that regularly enlists in coups have repeatedly thwarted progress. I do not recall a sustained period of peace, stability, and prosperity during my lifetime.

I was born during General Ayub Khan’s martial law. I was a child when General Yahya seized power in another coup and presided over the dismemberment of Pakistan. I was a teenager when General Zia-ul-Haq imposed his martial law, hanged the elected Prime Minister, Zulfiqar Ali Bhutto, and ushered in Islamism. By 1999 when General Musharraf ousted Prime Minister Nawaz Sharif and sent him into exile, I had married and moved to London.

I remember vividly the 1971 war with India that led to the secession of East Pakistan and the creation of Bangladesh. I remember the air sirens, the black-outs, the sound of strafing at night. I can see the L-shaped trench in our back garden, hear the whoosh of low-flying fighter planes and remember the solemnity of our driver’s face as he announced that we were sure to defeat India because he had seen a mighty silver scimitar shimmering in the dawn sky. And I recall with absolute clarity the day my ten-year-old elder brother ran across the garden toward me, screaming, “We’ve surrendered! We’ve lost! We’ve lost East Pakistan!”

Of Zia-ul-Haq’s martial law which began in 1977, my memories are of an altogether different order. On the day the mustachioed general arrested Prime Minister Zulfiqar Ali Bhutto and assured the nation that he would hold elections in ninety days, I was attending the wedding of a family friend. In the midst of the festivities, a child shouted at the assembled guests, “Come and watch! There’s a soldier inside TV!” Zia stayed for eleven years.

I was one of many who expressed quiet relief when Musharraf seized power in 1999.

Until his plane fell out of the sky in 1988, he brutalized an entire nation. He banned political parties and jailed activists. He had journalists who did not toe the military line flogged. Having ousted a populist leader, Zia used Islam to bolster his appeal. Only painters of Qur’anic calligraphy and anodyne landscapes were allowed to exhibit in public galleries. He shut down movie theatres, declared dancers obscene, and silenced poets. Female newscasters on television were forced to cover their heads, and secular music and television programs were replaced by Qur’anic recitals and interminable debates among bearded ulema (scholars) on whether it was a sin to be left-handed and if the name Mohammed could be abbreviated to Mohd without displeasing God.

With one amendment after another, Zia mangled the Constitution and slashed the rights of women and minorities. Under new laws, the rape of a married woman was deemed adultery (unless four adult muslim males testified to witnessing rape), and the sentence for adultery became death by stoning. Sharia law was supreme, and the Qur’anic punishment for theft—amputation of a hand—was officially enforced. Blasphemy became punishable by death.

I remember being beaten by baton-wielding policemen when I demanded the reinstatement of my rights with a small band of defiant women on the streets of Lahore. I remember praying that I would not be fined and jailed because I had ventured out for dinner to a friend’s place on New Year’s Eve. I remember going with a group of women friends to one of the last surviving cinemas in Lahore and being bullied by bearded thugs who insisted that we return forthwith to the “sanctity of our homes.” I remember the afternoon a policeman demanded that I prove I was legally married to the male friend who was giving me a lift in his car. I remember the day plainclothes policemen barrelled their way into my brother-in-law’s bookshop and dragged him off without charge to the 400-year-old dungeons at Lahore Fort. His crime? He had published a book critical of the United States’ role in Pakistani politics. I remember with horror the first public hanging in Lahore.

Then as now, a war was raging on our western border. Then as now, the United States had declared Pakistan a valued ally in its battle against an “Evil Empire” whose forces had overrun Afghanistan. Mujahideen—“fighters of Jihad”—were being trained and supplied by the CIA in Peshawar, the capital city of Pakistan’s North West Frontier province. General Zia was a trusted friend and accomplice. If the people of Pakistan had any grievances, the West did not wish to hear.

But unsupported and weak as they were, the people of Pakistan fought back. Political workers remained active underground. In their inner pages, newspapers continued to carry stories critical of the regime. When artists were barred from displaying their work in public spaces, ordinary citizens opened galleries in their homes. Subversive theatre productions, mocking the General and scornful of his enforced piety, were staged in private homes. When the middle-aged diva Iqbal Bano—young rock bands were brutally suppressed—departed from her script and burst into a spirited rendition of a populist song at an otherwise-polite concert of classical music in 1987, the audience roared its approval.

I was in Karachi on the day news of General Zia’s assassination broke. As I drove home, I saw people dancing in the streets. I had barely driven through the gate when a neighbor loped over. “Congratulations!” he beamed. “The General has exploded!”

Soon after, Pakistan held elections, and I was glued to the television as results trickled in through the night. The first time Benazir Bhutto—so young, so beautiful, so full of promise—appeared on the screen, I wept. But my euphoria was short-lived. Over the next decade, four separate civilian governments came and went. As each was dismissed on charges of gross incompetence and corruption, people’s optimism turned to weariness and cynicism.

I was one of many who expressed quiet relief when Musharraf seized power in 1999. In his second term, Nawaz Sharif, Bhutto’s archrival, had moved closer to the mullahs and grown increasingly autocratic. When my brother-in-law, Najam Sethi, by then the editor of a national paper, ran stories of Sharif’s personal corruption, Sharif sent two vanloads of policemen to his house. Breaking into Najam’s bedroom, they dragged him away with a loaded gun pressed to his temple. In his autobiography, In the Line of Fire, Musharraf records that his first serious disagreement with Nawaz Sharif occurred when he refused the Prime Minister’s order to court martial “a newspaper editor.” The second—and last—time the two fell out was when Sharif tried to remove him as army chief. Musharraf responded by ousting Sharif in a military coup.

“Victory” came at a price for Pakistan. Three million Afghan refugees streamed across the border and into the North West Frontier province. In their wake came the heroin trade, Wahhabism, and a wealth of sophisticated weaponry.

From my home in London, I anxiously watched the Pakistani news reports. Though relieved to see the back of Sharif, I was initially wary of the new general. By then I knew what military rule could mean. But my worst fears were dispelled when I saw him pose for his first staged photos in the lush lawns of Army House with a fluffy dog under each arm. Since mullahs consider dogs unclean, I took his choice of props as a clear sign of his secular leanings. His talk of accountability endeared him further to a nation sickened by the rampant corruption of its civilian leaders. And when he promised to promote enlightened moderation and economic development, the ghost of General Zia was finally exorcised from my mind.

But Musharraf’s personal convictions had little bearing on the Pakistani army’s ingrained beliefs. Having fought three wars (one was lost badly, the others ended in ceasefires) with its hostile eastern neighbor, India, the army learned that, while it could not win a conventional war against a vastly superior army, it could keep India bogged down by supporting separatist insurgencies within its territory. The Pakistani army also came to count on “strategic depth” in the form of a friendly neighbor on its western flank to counter the threat in the east.

The Russian invasion of Afghanistan had set the stage twenty years earlier. When the United States elevated Pakistan to a “frontline state” in the war against Communism, not only did the Pakistani army, under the leadership of General Zia, receive huge military assistance from the CIA, but Peshawar also became the global headquarters of jihad. Muslim fighters from all over the world converged on Peshawar to receive training before going into Afghanistan to wage holy war against Russian infidels. The United States supplied dollars and arms to the war effort; the Pakistani army got training and logistical support. When, after nine years of brutal fighting, the Russians withdrew from Afghanistan, the victory belonged not just to the United States but to the Pakistani army, which now had a friendly neighbor on its western border in the shape of the Taliban— originally a group of young hardliners backed by both the CIA and the Pakistani army.

Of course, “victory” came at a price for Pakistan. Three million Afghan refugees streamed across the border and into the North West Frontier province. In their wake came the heroin trade, Wahhabism, and a wealth of sophisticated weaponry.

The war’s most profound legacy may have been change within the Pakistani army. Traditionally, the army’s top brass comprised westernized, Sandringham-trained, upper-middle-class types more familiar with the mess than the mosque. Under General Zia, a different sort of officer rose to prominence: homegrown, middle-class, personally pious and fiercely ideological, raised on the rhetoric of jihad in Afghanistan. Always self-important, the army was so flush with a sense of mission after it helped defeat the mighty Soviet army that it considered itself unaccountable to any civilian institution and, even in subsequent periods of civilian government, retained the defense portfolio for itself. Not content with hogging the lion’s share of the national budget, it strengthened its financial might by spreading its tentacles into agriculture, industry, real estate, and banking. To quote the noted Pakistani human rights activist Asma Jahanagir: “The only business that the Pakistani military is not involved in is hairdressing!” By the mid-’80s, Military Inc. had become Pakistan’s largest commercial empire.

The United States, meanwhile, quickly lost interest in Pakistan and the army of mujahideen it had raised. The dollars dried up, and in Afghanistan the various warlords, the Northern Alliance, and the Taliban were left to slug it out amidst the smoking ruins of that once-stable land. The Pakistani army, pursuing its own strategic interest, continued to support the Taliban until they had conquered nearly all of Afghanistan.

Grappling with the blowback of the war, Pakistanis began to change their view of the United States as a trusted ally. The impression strengthened during the Gulf War, when the United States turned on an erstwhile ally, Saddam Hussein. Pakistanis also noted that the United States came to the defense of oil-rich Kuwait, but not to the aid of the suffering Afghan people who had helped it defeat its most implacable enemy. In 1998, when Pakistan tested a nuclear device in response to tests India had conducted a few weeks earlier, the United States slapped sanctions on Pakistan, further rupturing relations.

Hence when General Musharraf seized power in 1999, the international community viewed him unanimously as a pariah. He continued to support the Taliban in Afghanistan while providing covert assistance to the separatist movement that had erupted in the late ’80s in Indian-held Kashmir. But soon after September 11, 2001, the Bush administration abruptly revived relations with a phone call demanding that Musharraf immediately roll back his army’s twenty-year policy in Afghanistan and become a linchpin in the “War on Terror”—or face the consequences. Left with little choice, Musharraf agreed.

I witnessed Pakistan’s rapid economic transformation. Independent television channels, private radio stations, newspapers, and magazines sprang up like mosquitoes after the monsoon.

From the outset Musharraf’s decision was highly unpopular in Pakistan. Strong anti-American sentiment fed sympathy for the Islamists, popularly viewed as plucky little Davids against America’s Goliath. The general’s decision was also controversial among hardliners in the army. Already lacking a mandate from the people, Musharraf was now in the unenviable position of having to ram an unpopular war down their throats. His own training as an army man also made the choice unpalatable.

So began eight years of a tightrope walk during which Musharraf tried to appease his American paymasters and his Pakistani constituency. In return for billions of dollars from Congress and the Bush administration, he allowed American forces to use Pakistani soil to transport vehicles and weaponry to Afghanistan. Every once in a while, Pakistani intelligence agencies would make a high profile arrest of an al Qaeda asset for rendition. Despite oft-repeated promises, he did not close down madrassahs or pursue Taliban and al Qaeda fighters fleeing Afghanistan for the mountainous borderlands of Pakistan in the wake of allied attacks in 2001. Under U.S. pressure Pakistani forces engaged extremists in the Tribal Areas, but the action was desultory and half-hearted.

Musharraf’s doublespeak about “enlightened moderation” was not confined to appeasing Americans alone. At home he appeared to promote a comparatively liberal agenda, with the media freer than ever and more latitude afforded women and minorities. In addition, foreign investment in the telecom sector, dramatic growth in textile exports, and high remittances from a cash-rich Middle East brought about a mini-boom in the economy.

On post-9/11 annual visits home, I witnessed Pakistan’s rapid economic transformation. Independent television channels, private radio stations, newspapers, and magazines sprang up like mosquitoes after the monsoon. What in the mid-’90s had been my monthly salary as a features editor in a national newspaper, magazines now casually offered me for a single article. When I drove past the slums of Lahore, I saw rows of gleaming satellite dishes. Everyone tuned into CNN, Sky, Al Jazeera, and the BBC, in addition to Pakistani channels—Geo, Aaj, Dawn. There were Internet cafés at every corner. Shops were full of the latest goodies—iPods, mobile phones, laptops, home theaters—and thronged with customers.

But other developments shadowed the new prosperity. Alongside reruns of Baywatch on PrimeTV, programs extolled the virtues of jihad. Maulana Fazlullah, a hard-line cleric in the northern territory of Swat, recruited jihadis openly through his three radio stations. Many of my old classmates from the Convent of Jesus and Mary, whose mothers wore skimpy saris in their day, were in hijab. Huge posters of Osama Bin Laden adorned shop façades and the sides of trucks. English medium schools, where all instruction is in English, remained popular among some segments of the population, but madrassahs were still the only option for many. Next to the Lahore School of Economics, in my parents’ prosperous neighborhood, was a girls’ seminary, where students aged three and older covered themselves in black. Suicide bombings meant to terrorize secular Pakistanis had become a fact of life.

Tensions came to the fore. Having regrouped in Pakistan’s Tribal Areas, extremists were not content with simply killing NATO and American forces in Afghanistan. They established parallel governments, and as more and more Pakistani territory fell to them, they closed down girls’ schools, imposed Sharia law, executed dissenters, extorted “protection” taxes, recruited foot soldiers from local populations, and fought off the Pakistani army in increasingly violent, audacious encounters. Emboldened by their success, they targeted organs of the state as well as high-profile Pakistani politicians and ordinary citizens in suicide attacks.

Musharraf survived several assassination attempts, but while Benazir Bhutto emerged unhurt from an attempted assassination in October 2007 that killed 200 people, the second, on December 27, claimed her life. Extremists have also killed journalists and aid workers.

A combination of intense American pressure and an eventual realization of the extremists’ long-term goals appear finally to have goaded the army into more serious action. Since last June, it has made concerted efforts to reclaim territory lost to extremists. But it has not been easy. Trained to fight Indians in open plains in conventional warfare, the Pakistani army is finding it hard to mount a counterinsurgency against its own people in remote mountainous regions. Extremists are now literally entrenched in the Tribal Areas, where they have dug mile-long tunnels so deep that only 500 pound bombs can penetrate.

The convergence of political instability and economic collapse has driven Pakistan into a maelstrom.

Politicians, the media, the army, and the people are still bitterly divided over the legitimacy and necessity of this war. Coalition partners in the civilian government as well as the opposition call for peace deals, while Benazir’s People’s Party, now headed by her widower Asif Zardari, sides with military action. Whether President Zardari—working against a history of corruption allegations to win the trust of the people—is up to the job remains to be seen. Meanwhile, the Bush administration, impatient with Pakistan’s inability or unwillingness, attacked Islamist hideouts deep inside Pakistani territory via unmanned drones until its last days. That policy has continued under Obama, who ordered similar airstrikes that killed twenty-two people during his first week in office.

The economic front is equally grim. Throughout 2007 the military government subsidized the price of oil. When the civilian government took over in February 2008, it was forced to raise prices. Inflation skyrocketed. Pakistan produced a bumper wheat crop last year, but much of it was lost to export and smuggling to Afghanistan and India, and the price of bread rose sharply. Sugar and oil were already in short supply. The cost of food climbed more than 30 percent last year.

Musharraf’s government also failed to invest in energy production. With a massive shortfall in electricity, urban centers lack power for at least half the day. (In rural areas, power outages can last up to eighteeen hours). Unable to afford fuel, many factories have closed and laid off employees. Musharraf’s much-vaunted economic reform, which produced a banking and telecom revolution, had shallow roots in the economy, generating relatively little employment or long-term economic benefits for working people. With the rest of the world facing a recession, remittances from the Middle East have also fallen off. Pakistan was on the verge of defaulting on its debts until the International Montetary Fund bailed out the government.

The convergence of political instability and economic collapse has driven Pakistan into a maelstrom. The Pakistani government must “own” the war against extremists, give it legitimacy, and get the people behind it. The army, too, has no choice but to abandon all notions of strategic depth, rein in rogue elements within its ranks, and back the government in executing the war honestly and efficiently. Americans, meanwhile, need to mend fences with the Pakistani people. Thus far the balance of American aid has equipped the army to fight wars and oppress its own people. Now funds must be diverted toward investment in development projects and institution-building. Pakistan’s economy needs a huge infusion of foreign and domestic investment. But political stability is a prerequisite for investment. Without it, Pakistan will tip into the abyss of a failed state.