RAWALPINDI, Pakistan — Pakistan’s top military official said Friday that the country’s powerful army was not contemplating a coup, pushing back on a rare and vehement accusation the country’s prime minister made the day before.

Army Chief of Staff Ashfaq Pervez Kayani said the country’s armed forces remain committed to the democratic process.

“The army is fully cognizant of its constitutional obligations and responsibilities,” he said in an address to Pakistani troops.

Kayani’s speech appeared to be a retort to Prime Minister Yousuf Raza Gilani’s warning on Thursday of a conspiracy to oust the government, an unusually blunt message that signaled that tension between his civilian administration and Pakistan’s army might be close to a breaking point.

Gilani’s remarks come amid a widening scandal involving a secret memo that his administration supposedly sent to Washington in the spring asking for help to avert a possible coup.

“There can be no state within a state,” Gilani said during an event commemorating the birth of Pakistan’s founder on Thursday. “People will have to decide whether they want elected people or a dictatorship in the country.”

The rumors about a coup have set off alarms in Washington and Kabul, where many officials accuse the Pakistani military of playing a spoiler role in America’s war with the Taliban. In Pakistan, military chiefs wield more power than civilian leaders and have a long history of staging coups.

The ouster of the current government would probably destabilize the nuclear-armed nation, potentially generating a flurry of new challenges for U.S. commanders in Afghanistan as they struggle to wind down the war.

Citing military officials who spoke on the condition of anonymity, Reuters news agency reported Thursday that Pakistan’s military chiefs would like to see President Asif Ali Zardari leave office but were exploring legal means, rather than a coup. On Friday, Zardari’s office said the president has no intention of leaving the country over the memo scandal, Reuters reported.

Gilani’s remarks represented a striking shift for a leader who only a week ago dismissed the notion that there was a widening rift between his administration and the security forces. “Every institution of this country, including the Ministry of Defense, is under the prime minister,” Gilani asserted.

The genesis of the political crisis was the U.S. raid in May that killed al-Qaeda leader Osama bin Laden. Pakistan’s military and intelligence services, long suspected of having ties with insurgent groups, came under unprecedented criticism because bin Laden was found in a garrison town near Islamabad, the capital.

Last month, a Pakistani American businessman accused Husain Haqqani, who was then Pakistan’s ambassador to the United States, of instigating a written plea to the Pentagon requesting help to prevent a possible coup. Haqqani and Pakistan’s civilian leaders have denied making such a petition, but the envoy resigned in the wake of the scandal, and Pakistan’s Supreme Court and parliament have launched investigations.

Gilani also addressed members of parliament on Thursday, asking them to help him exert oversight over military leaders.

“The government stood by the security forces in difficult times,” Gilani told lawmakers. “We stood by them during the storm created by American pressure over bin Laden’s killing, and it was during the tough circumstances that we doubled their salaries.”

He added that the security forces “need to be accountable to the parliament, which is supreme.”

Correspondent Ernesto Londoño in Kabul contributed to this report.