Ozier Muhammad/The New York Times

Updated President Obama said on Wednesday that he is seeking to block the release of photographs that depict American military personnel abusing captives in Iraq and Afghanistan, worrying that the images could “further inflame anti-American opinion.”

As he left the White House to fly to Arizona for an evening commencement address, Mr. Obama briefly explained his abrupt reversal on releasing the photographs. He said the pictures, which he has reviewed, “are not particularly sensational, but the conduct did not conform with the Army manual.”

He did not take questions from reporters, but said disclosing the photos would have “a chilling effect” on future attempts to investigate detainee abuse.

The president’s decision marks a sharp reversal from a decision made last month by the Pentagon, which agreed in a case with the American Civil Liberties Union to release photographs showing incidents at Abu Ghraib and a half-dozen other prisons. At the time, the president signed off on the decision, saying he agreed with releasing the photos.

Robert Gibbs, the White House press secretary, said that the president met last week “with his legal team and told them that he did not feel comfortable with the release of the D.O.D. photos because he believes their release would endanger our troops.”

Mr. Obama has examined a sampling of the photographs within the last two weeks, Mr. Gibbs said, as he “spent some time reflecting on” the case to make the decision that was announced Wednesday.

Mr. Obama advised his top military commanders about his decision in a meeting on Tuesday at the White House. Several military officials had argued against the immediate release of the photographs, saying such action could harm American troops in the field.

“The president strongly believes that the release of these photos, particularly at this time, would only serve the purpose of inflaming the theaters of war, jeopardizing U.S. forces,” the official said, “and making our job more difficult in places like Iraq and Afghanistan.”

Officials said that one argument made to delay releasing the pictures was that the missions in both Iraq and Afghanistan were entering risky, new phases. In Iraq, American combat forces are withdrawing from urban areas and are reducing their numbers nationwide. In Afghanistan, more than 20,000 new troops are flowing in to combat an insurgency that has grown in potency.

At a Defense budget hearing on Capitol Hill later on Wednesday afternoon, Defense Secretary Robert M. Gates indicated that the White House might appeal the decision to the Supreme Court. “I believe that’s under consideration,” Mr. Gates told the House Armed Services Committee.

Mr. Gates also said that he had changed his opinion about releasing the photographs because of the strong views of his commanders. “Both General McKiernan and General Odierno have expressed very serious reservations about this and their very great worry that release of these photographs will cost American lives,” Mr. Gates said.

Geoff Morrell, the Pentagon press secretary, said earlier that Generals Odierno, McKiernan and also David Petraeus “have all voiced real concern about this. Particularly in Afghanistan, this is the last thing they need.”

Mr. Gates shared the concerns of his commanders about the impact of the photo release on the troops and the battlefield, and had had a “multitude of conversations” with Mr. Obama on the issue.

The Pentagon’s decision to release the pictures came after the A.C.L.U. prevailed at the Federal District Court level and before a panel of the Second Circuit. The photographs were set to be released on May 28. But as that date approached, a growing sense of unease among military officials was expressed to Mr. Gates, who relayed the concerns to the president.

Many also recalled the Abu Ghraib photographs, showing prisoners naked or in degrading positions, sometimes with Americans posing smugly nearby, caused an uproar in the Arab world and concerns within the military that the actions of a relatively few service members had tainted the entire forces.

In this more recent case, the A.C.L.U. argued that disclosing the pictures was “critical for helping the public understand the scope and scale of prisoner abuse as well as for holding senior officials accountable for authorizing or permitting such abuse,” said Amrit Singh, who argued the case on behalf of the group before the Second Circuit Court of Appeals in Manhattan.

The A.C.L.U. sharply criticized the president’s decision. In a statement, its executive director, Anthony D. Romero said:

“The Obama administration’s adoption of the stonewalling tactics and opaque policies of the Bush administration flies in the face of the president’s stated desire to restore the rule of law, to revive our moral standing in the world and to lead a transparent government. This decision is particularly disturbing given the Justice Department’s failure to initiate a criminal investigation of torture crimes under the Bush administration. “It is true that these photos would be disturbing; the day we are no longer disturbed by such repugnant acts would be a sad one. In America, every fact and document gets known – whether now or years from now. And when these photos do see the light of day, the outrage will focus not only on the commission of torture by the Bush administration but on the Obama administration’s complicity in covering them up. Any outrage related to these photos should be due not to their release but to the very crimes depicted in them. Only by looking squarely in the mirror, acknowledging the crimes of the past and achieving accountability can we move forward and ensure that these atrocities are not repeated.”

A senior administration official said that the president met last week with his legal team and reached the conclusion that the interests of the military and the U.S. government would not be served by releasing the photos.

“The president would be the last to excuse the actions depicted in these photos,” the administration official said. “That is why the Department of Defense investigated these cases, and why individuals have been punished through prison sentences, discharges, and a range of other punitive measures.”

The next step was not immediately clear. White House officials said a court filing was due on Wednesday, which would outline the administration’s legal approach.

During the court case, defense officials had fought the release of the photographs, connected with investigations between 2003 and 2006, on the grounds that the release could endanger American military personnel overseas and that the privacy of detainees would be violated. But the Second Circuit, in upholding a lower court ruling, said the public interest involved in release of the pictures outweighed a vague, speculative fear of danger to the American military or violation of the detainees’ privacy.

One Pentagon official involved in the discussion said the photos show detainees in humiliating positions, but stressed that they were not as provocative as pictures of detainee abuse at Abu Ghraib.

The official said the photos show detainee nudity, and that some include images of detainees shackled for transfer. Other photographs show American military personnel with weapons drawn and pointed at detainees in what another official said had the appearance of “a war trophy.”

One argument made by Pentagon and military officials who oppose the release is that they do not contribute to public knowledge of American policy, as might the release of other memos by the Office of the Legal Counsel. One example cited in internal discussions was the series of riots that followed publication of cartoons by Danish newspapers that were viewed as hostile and insulting to Islam.

The release of these detainee photographs, Pentagon and military officials said, would only serve to provoke outrage and, in particular, might be used by violent extremists to stoke attacks and recruit suicide bombers. Military personnel in Iraq and Afghanistan were said to be particular targets of such attacks, but officials said that civilian targets might be chosen by extremists, as well.

In a letter dated April 23, Lev L. Dassin, the acting United States Attorney in this case, wrote to Judge Alvin K. Hellerstein of the Southern District, to say that the Pentagon had agreed to release 44 photographs involved in the case, plus ”a substantial number of other images” gathered by Army investigators.

Elisabeth Bumiller and Thom Shanker contributed to this post.