"In effect, they were restoring democracy," Mr. Kerry said of Egypt's military to Pakistan's Geo News while in Pakistan on Thursday. "The military did not take over, to the best of our judgmentso far, so farto run the country. There's a civilian government."
The comments were the closest the Obama administration has come to endorsing the military's July 3 removal of Mr. Morsi, Egypt's first democratically elected president, following huge demonstrations against his rule. Washington's stated policy has been that it doesn't support Mr. Morsi's overthrow and that it seeks a quick restoration of civilian rule in Cairo.
"He did not stick to the script," said a U.S. official, referring to Mr. Kerry's comments.
Fears of a further anti-Morsi crackdown loomed on Thursday, after the military-backed government asked the Interior Ministry to "deal" with a large pro-Morsi protest encampment in Cairo that they say has been an incubator for violent riots and terrorism. Egypt's military has killed more than 100 pro-Morsi protesters in the past month.
Mr. Kerry spoke to the question of Egypt's continuing unrest. "We're very, very concerned about" violence, he said. "We have made it clear that that is absolutely unacceptable. It cannot happen. As you know, these situations can be very confusing and very difficult."
Mr. Kerry chose a problematic venue in which to defend a military takeover. Coup-prone Pakistan only recently pushed its highly politicized military out of top government seats. Pakistani leaders issued strong condemnations of Mr. Morsi's ouster.
Like Egypt's military, Pakistani generals enjoy close relations with their American counterparts.
Mr. Kerry hewed to the Egyptian military's narrative: that it acted in the service of the public will. "The military was asked to intervene by millions and millions of people, all of whom were afraid of the descent into chaos, into violence," he said.
Many of Mr. Morsi's supporters already accuse the U.S. of blessing a coup in order to suppress the political rise of Egypt's Islamists. The U.S., they say, wants to spread democracy on its own terms while writing Islamist parties out of the equation.
Mr. Kerry stopped short of resolving a monthlong policy debate in Washington about whether to designate Mr. Morsi's removal a coup. The White House said last week that it didn't intend to put a label on last month's uprising. Using the word "coup" could lead to the cancellation of $1.3 billion in annual military aid the U.S. has given Egypt since the 1980s.
Though the U.S. has long had close ties to Egypt's military, politicians in the new government in Cairo have been critical of what they perceive as U.S. support for Mr. Morsi and his Muslim Brotherhoodbackers.The ousted Egyptian president's holdout supporters were still camped out by the thousands on Thursday in Raba'a al Adiwiya Square, even as the minister of interior warned them to leave over state television, offering them a safe exit without police harassment.
Early Saturday morning, a shootout with police down the street from the square ended with 74 people killed, the vast majority of them protesters. On Thursday, some were eager to show off wounds they said were caused by live ammunition.
"The minister of interior is illegitimate," said Mamdouh Mohammed, 27 years old, who was selling watermelons to protesters a few hours before the evening fast-breaking meal that Muslims observe during Ramadan. "Here in Egypt, we don't have democracy."
Residents said they hadn't seen any nearby police or troop movements since the cabinet said it would dissolve their tent city, along with another protest camp at Nahda Square in the Cairo suburb of Giza.
Many Morsi supporters said they intended to remain in Raba'a al Adiwiya Square, but if forced out would simply go elsewhere. "This isn't the only square in Cairo," said Yasser al-Fakharany, a Muslim Brotherhood media representative.
A version of this article appeared August 2, 2013, on page A8 in the U.S. edition of The Wall Street Journal, with the headline: Kerry Lauds Egypt's Military, In Departure from U.S. Script.