There are inherent dangers in continuing tense relations between the army and the government
As a wave of militant attacks hits Pakistan, tensions between the army and the civilian government have hit a new high, despite promises by the military establishment that it would no longer intervene in politics. Guest columnist Ahmed Rashid has this assessment.
The renewed tension comes as feverish speculation has gripped the country about the army's intentions, after it forced the government to backtrack on a US bill which provides Pakistan with millions of dollars as long as it pledges to eradicate Taliban and al-Qaeda militancy.
At least nine Taliban suicide attacks have hit Pakistan's security forces in the days from 5 October - including a devastating and embarrassing siege inside the army's General Headquarters (GHQ) in Rawalpindi that claimed 22 lives, and three attacks on a single day in Lahore.
Over 150 people have been killed and several hundreds injured.
However, these attacks did not stop army chief Gen Ashfaq Parvez Kayani from challenging the government and the US administration as Washington's crucial aid bill - which has taken more than a year to pass through the US Congress - was finally ready for signing on President Obama's desk.
Caught by surprise
It was while on a visit to Kabul in late September that Gen Kayani first conveyed to Gen Stanley McCrystal, the US commander in Afghanistan, that he found the bill insulting and demeaning to the army.
Pakistan is currently been hit by a sustained bout of militant attacks
On 7 October Gen Kayani summoned the army's most powerful assembly - a meeting of the nine corps commanders - who questioned the bill saying it impacted on Pakistan's national security.
In the meantime the military launched a massive public relations exercise, briefing sympathetic TV talk show hosts and journalists, who were encouraged to whip up public opinion against the bill.
Gen Kayani also secretly met the main opposition politician Shahbaz Sharif, the chief minister of Punjab province, who the army had ostracised until now.
Caught completely by surprise, President Asif Ali Zardari and the Pakistan People's Party (PPP) government faced an onslaught of accusations in parliament and in the media that they were traitors who had sold out to the US.
The US bill will provide Pakistan's civilian and development sector with $1.5bn a year for the next five years while the military would have a separate aid bill worth over $1bn a year.
It would be the first time in the history of the relationship between the US and Pakistan that Washington would be giving so much money to a civilian government - in the past it had lavished its cash on military regimes.
The bill set tough conditions for a military that has never been questioned before or come under democratic supervision.
It demanded that Pakistan remained a democracy and that civilian control was maintained over the army and the defence budget, while the government continued to fight extremism.
However, these conditions were wrapped in a let-off clause that gave the US president waiver rights to continue aid, even if the bill's conditions were not met.
The bill had been through multiple drafts and had been watered down considerably after negotiations with the Pakistan government, foreign ministry and army which had objected to language used in earlier drafts, especially about Pakistan's nuclear programme.
The army is arguably Pakistan's most powerful institution
US officials told the BBC that Congress Foreign Affairs Committee Chairman Howard Berman had personally briefed Gen Kayani, while Senate Foreign Relations Committee Chairman John Kerry visited Pakistan several times over the past two years and met generals from the army and the Inter Services Intelligence (ISI).
There had clearly been ample opportunities for the army to voice any objections to the bill months before.
Moreover, the US bill was critical to convince the European and Arab donors to give more aid to Pakistan. They have held up some $5bn in aid, waiting for the Americans to commit their money first.
Pakistan is battling the Taliban in the midst of a huge economic downturn, massive unemployment and an acute energy shortage - there is no electricity in major cities for up to 10 hours a day.
The government is bankrupt and is surviving on a $11.3bn loan from the International Monetary Fund.
US legislators were furious with the army's statement. Mr Berman told the Washington Post that although "billions have gone down a rat hole in the past" in Pakistan, he did not want to "micromanage" the country's use of the new money.
State Department officials said they were trying to restrain angry legislators from saying anything more.
On 14 October Mr Kerry and Mr Berman released an "explanatory" statement saying that the US had no desire to impinge on Pakistan's sovereignty.
The PPP government was left holding the baby, abandoned by everyone and becoming the sole defenders of the bill.
The army is facing a series of Taliban suicide bombings
Not surprisingly they are convinced that the army's move was part of a long term plan to unseat Mr Zardari as president and bring in someone more compliant - or at the very least force the president to sack some of his advisers whom the army loathes.
Mr Zardari, the widower of slain political icon Benazir Bhutto, has long taken a diametrically opposite view to the army on foreign policy - he would like peace with India, closer ties to the US and an end to the safe havens the Afghan Taliban have in Pakistan.
However, the president has not helped build his case with the public because his government is considered weak, incompetent and corrupt.
Moreover it has handed over command and control of the war against the Pakistani Taliban to the army. In the recent army offensive to clear the Taliban out of the Swat valley, the army rather than the civilian government led the relief effort for two million displaced people.
Now with the army promising to launch an offensive against Pakistani Taliban leaders holed up in South Waziristan, the Obama administration cannot afford to annoy the military.
The Pakistan Taliban are not only fighting the Pakistan state but also the US troops in Afghanistan.
However, the problems between the army and the civilian government will not go away and the inherent dangers associated with that have only increased the problems for President Obama as he decides on a strategy towards Afghanistan and Pakistan.
Ahmed Rashid is the author of the best-selling book Taliban and, most recently, of Descent into Chaos: How the war against Islamic extremism is being lost in Pakistan, Afghanistan and Central Asia.
If you have a comment on this article, please use the form below.
The BBC may edit your comments and not all emails will be published. Your comments may be published on any BBC media worldwide.