Late in April, Ashfaq Pervez Kayani stood before a solemn audience that had gathered to mark Martyrs Day.

“There is no greater honour than martyrdom”, Pakistan's army chief said, “nor any aspiration greater than it. When people are determined to achieve great objectives, they develop the faith needed to trust their lives to the care of Allah. We are well aware of the historical reality that nations must be willing to make great sacrifices for their freedom”. “I am proud”, he went on, “that the nation has never forgotten the sacrifices of its martyrs and holy warriors”.

If it hadn't been for General Kayani's impeccably-ironed military uniform, his audience might have been forgiven for believing that the speech was being made by the Islamist clerics who have exhorted insurgents to claim the lives of over 2,700 Pakistani troops in combat.

Pakistan's Prime Minister went on national television in July to give his country's army chief an unprecedented three year extension of service. The decision has won applause in some western capitals, as well as from some liberal and conservative commentators in Pakistan. In the midst of a bitter war against Islamists many believe poses the greatest existential threat Pakistan has ever faced, Kayani's supporters believe its army needs continuity of leadership.

Those propositions might be true — but casts little light on the strategic considerations which have given Kayani three more years in office. Pakistan's army hopes, in essence, that Kayani will be able to craft a way out of the crisis without compromising the power and influence of its generals.

Islamabad elites had long been discussing Kayani's plans to secure an extension; this newspaper carried an extensive discussion of the issue in March. Key politicians, though, were evidently clueless. On May 17, Pakistani Defence Minister Chaudhry Ahmed Mukhtar said the government “was neither granting extension to Chief of Army Staff; nor had the general sought it.” But just a week later, media reported that a conference of corps commanders had called for an extension.

Some accounts hold that President Asif Ali Zardari, who is distrusted by the army, had little choice but to accept this fait accompli. Other commentary suggests both President Zardari and Prime Minister Gilani went along with decision, hoping to stave off any confrontation with the armed forces until 2013 — the year their terms in office end. Either way, as Pakistani lawyer and political commentator Asma Jehangir has noted, the extension suggests “that democracy has not taken root. The decision was taken on the basis of obvious pressure from the military”.

But just what was it that drove this pressure? Pakistan's army isn't, after all, short of competent commanders. “My advice to Kayani”, wrote the commentator Kamran Shafi days before the extension, “would be to issue his last Order of the Day on the appointed date of his retirement, receive his successor in General Head-Quarters, and after a cup of tea get into his private car and fade away.” There are good reasons, though, why that advice wasn't heeded.

The Pakistan army's agenda

Kayani is at the centre of three projects critical to the long-term power of the Pakistan army. The first is this: extricating the Pakistan army from a counter-insurgency campaign that appears unwinnable. During Kayani's visit to troops in Orakzai on June 1, the Pakistan army announced “the successful conclusion of operations in the Agency”. But, as analyst Tushar Rajan Mohanty recently pointed out, it has admitted to over a dozen engagements there since, involving the use of combat jets and helicopter gunships. Refugees displaced last year are yet to return.

Hoping to manoeuvre an exit, Kayani has escalated support to the jihadist networks of the Islamic Emirate of Afghanistan and Maulana Jalaluddin Haqqani. Last week, Canadian diplomat Chris Alexander — who spent seven years serving his country and the United Nations in Afghanistan — charged Kayani with “sponsoring a large-scale, covert guerrilla war through Afghan proxies.” “Without Pakistani military support,” Alexander asserted “all signs are the Islamic Emirate's combat units would collapse”. Earlier, Harvard University's Matt Waldman quoted Islamic Emirate commanders admitting that the ISI's role was “as clear as the sun in the sky.”

Kayani, the Pakistan army hopes, will be able to secure it allies power in a future regime in Kabul — and then use their influence to scale back its conflict with the Tehreek-e-Taliban Pakistan at home. Pakistan has, notably, offered to broker a rapprochement between its jihadist allies and Afghan President Hamid Karzai's regime.

Linked to this objective, Kayani is working to heal President Musharraf's rupture with domestic jihadists — a constituency who were once drawn to state-backed organisations like the Lashkar-e-Taiba and Jaish-e-Mohammad, but have been increasingly supporting the Tehreek-e-Taliban Pakistan. Pakistan's India policy is being reinvented by Kayani to this end: the second project he needs time to see to fruition.

In a thoughtful 2002 paper for the Carnegie Endowment for International Peace, George Perkovich cast light on Musharraf's reappraisal of Pakistani military strategy on India. Lieutenant-General Moinuddin Haider, who served as interior minister under President Musharraf, told Perkovich he argued that the long-term costs of continuing to back jihadists would be higher than the potential losses from taking them on. President Musharraf feared that confrontation would provoke a civil war. “I was the sole voice initially”, Haider said, “saying, ‘Mr. President, your economic plan will not work, people will not invest, if you don't get rid of extremists.'”

Haider gathered allies — among them Pakistan's former intelligence chief, Lieutenant-General Javed Ashraf Qazi. “We must not be afraid,” General Qazi said in the wake of the 2001-2002 India-Pakistan military crisis “of admitting that the Jaish was involved in the deaths of thousands of innocent Kashmiris, bombing the Indian Parliament, [the journalist] Daniel Pearl's murder and even attempts on President Musharraf's life.”

But Musharraf did little to develop an institutional consensus around these ideas — and, as his legitimacy eroded, proved unable to make a decisive break with the past. Many in the Pakistan army blamed him for precipitating the internal crisis which developed during his term in office. Like so often in the past, the Pakistan army moved to force out a commander-turned-liability.

Ever since Kayani replaced Musharraf, there has been mounting evidence that the Pakistan army is seeking to renew hostility with India. In 2008, the United States was reported to have confronted Pakistan's army with evidence that the ISI was involved in a murderous attack on the Indian diplomatic mission in Kabul. Later that year, it is now known from the testimony of Pakistani-American jihadist David Headley, the ISI facilitated the carnage in Mumbai. Pakistan has denied its intelligence services were linked to the Mumbai attacks, but has neither questioned the officials Headley named, nor sought to interrogate him on the issue.

In February, Kayani told journalists the Pakistan army was an ‘India-centric institution', adding that this “reality will not change in any significant way until the Kashmir issue and water disputes are resolved”.

Language like this fits well with the intellectual climate of Pakistan's armed forces. Lieutenant-General Javed Hassan — who played a key role commanding Pakistan forces during the Kargil war — was commissioned by the army's Faculty of Research and Doctrinal Studies to produce a guide to India for serving officers. In India: A Study in Profile, published by the military-owned Services Book Club in 1990, Hassan argues that is driven by “the incorrigible militarism of the Hindus.” “For those that are weak,” he goes on, “the Hindu is exploitative and domineering.”

Faced with a flailing war against jihadists at home, Kayani's anti-India platform offers the army the strategic equivalent of an escape button: precipitating a crisis with a historic adversary, secure in the knowledge that Pakistan's nuclear umbrella guarantees is protection from a large-scale war. Pakistan's military, many Indian foreign policy analysts believe, precipitated the bruising showdown between Foreign Ministers SM Krishna and Shah Mehmood Qureshi in Islamabad last month, undermining the fragile dialogue between the two countries.

India and Afghanistan are just parts, though, of the third, and most important project: guaranteeing the political primacy of the Pakistan army. In the wake of President Mohammad Zia-ul-Haq's assassination in 1988, Pakistan developed what the scholar Hussain Haqqani — now his country's ambassador to the United States — described as “military rule by other means.” Hasan-Askari Rizvi noted that the army chief became the “pivot” for political system. The army chief, in turn, derived his authority from the corps commanders who addressed “not only security, professional and organisational matters, but also deliberate on domestic issues”.

In January 2008 General Kayani passed a directive which ordered military officers not to maintain contacts with politicians, and followed up with orders withdrawing serving personnel from civilian institutions. The move was interpreted as evidence of Kayani's commitment to genuine civilian-led democracy. But Kayani repulsed President Zardari's early efforts to bring the ISI under civilian control, and defeated his efforts to seek a grand rapprochement with India. Pakistan's army proved willing to cede influence over the administration of the state, but not over the structure and thrust of national strategy.

“The army is the nation,” General Ashfaq Pervez Kayani said in his Martyrs Day speech, “and the nation is with the army.” Ensuring that this pithy proposition survives the crisis Pakistan is faced with is the purpose of the silent coup that has given Kayani three more years in office.

More In: Lead | Opinion