Pakistan's military warned of "grievous consequences" from its worsening relations with the civilian government on Wednesday and Prime Minister Yusuf Raza Gilani fired the top defence bureaucrat as a crisis deepened in the country's leadership.
The powerful military has often been at odds with civilian leaders and has ruled Pakistan for more than half of its 64-year history as an independent state after repeated coups.
The "memogate" scandal - which erupted last year over a leaked document seeking US. help in preventing a coup - has brought tension between generals and politicians to the worst point since the army restored civilian rule after last seizing power in 1999.
That tension has raised fears for the stability of the nuclear-armed country, a vital if wary US ally.
Gilani's office said it sacked the defence secretary, retired Lieutenant General Naeem Khalid Lodhi, for "gross misconduct and illegal action which created misunderstanding" between institutions. Lodhi was the most senior civil servant responsible for military affairs, a post usually seen as the military's main advocate in the civilian bureaucracy.
The United States declined to speculate on the firing, with a Pentagon spokesman calling it an internal political development and saying it would not deter US efforts to improve ties.
The memogate scandal is now being investigated by the Supreme Court. Gilani told a Chinese news website this week the military had broken the constitution by issuing its responses to the probe without government permission.
The military denounced Gilani on Wednesday for accusing it of violating the law by responding to the investigation.
"There can be no allegation more serious than what the honourable prime minister has leveled," it said. "This has very serious ramifications with potentially grievous consequences for the country."
A senior military official told Reuters the latest tension was "very serious". Lodhi was replaced by cabinet secretary Nargis Sethi, who is considered close to Gilani.
If Gilani decides to dismiss the army or intelligence chiefs - arguably the two most powerful men in Pakistan - he needs the defence secretary on his side.
One senior member of the ruling Pakistan People's Party (PPP) said the government and the army were both digging in.
"The prime minister has started throwing down the gauntlet," the party member said, asking not to be identified.
But another top PPP official later played down talk of an imminent showdown.
"We've said before, we'll say it again: we don't go for a clash of institutions because in these conditions, Pakistan's people cannot afford to have the country's integrity harmed," Khursheed Shah told reporters.