Pakistani analysts said the firing of Mr. Lodhi might signal that the festering conflict between the army and the government was reaching a critical stage.

“It is a desperate measure,” said Ikram Sehgal, a defense analyst and a former army officer. “They want the army to react and to make a coup.”

Hasan-Askari Rizvi, a military and political analyst, said the firing would only exacerbate the situation for the civilian government. “If the prime minister now tries to fire the army chief, it will have very dangerous consequences,” Mr. Rizvi said.

Mr. Lodhi, who retired from the army last March and became defense secretary in November, became embroiled in a controversy last month after he submitted a statement in the Supreme Court on behalf of the Defense Ministry, saying that the civilian government had no operational control over the Inter-Services Intelligence Directorate, Pakistan’s powerful spy agency. Saying that Mr. Lodhi had overstepping his authority, Mr. Gilani objected to the blunt statement, a public acknowledgment that while the intelligence services are technically answerable to the prime minister, they are widely perceived to act independently of civilian control.

A military official who spoke on the condition of anonymity because he was not authorized to speak publicly said that the relationship between Mr. Lodhi and Mr. Gilani broke down after the prime minister’s staff pressed Mr. Lodhi to contradict statements about the controversial memo by the army and intelligence chiefs, Generals Kayani and Pasha. The two told the Supreme Court last month that the memo — said to have been orchestrated by a former ambassador to the United States, Husain Haqqani — was authentic, and pointed to a conspiracy against the military. The government and Mr. Haqqani have said that they had nothing to do with the memo, which came to light in October.

“The government had prepared a draft that stated that the Ministry of Defense does not agree with General Kayani and Genera Pasha’s opinions about the veracity of the memo,” said the military official, who was present during the discussions. “General Lodhi refused to sign the document, saying those were not his words.”