WASHINGTON (AP) — President Barack Obama will try to block the court-ordered release of hundreds of photos showing U.S. troops allegedly abusing prisoners, reversing his position after military commanders warned the graphic images could stoke anti-American sentiment and endanger soldiers.

The pictures are said to show mistreatment of detainees at locations in Iraq and Afghanistan.

The White House announced Obama's decision Wednesday, after top military commanders in the two wars expressed fears that showing the pictures could put their troops at higher risk. When photos emerged in 2004 from the infamous U.S.-run Abu Ghraib prison, showing grinning
U.S. soldiers posing with detainees – some of the prisoners naked, some being held on leashes – the pictures caused a huge anti-American backlash around the globe, particularly in the Muslim world.

The administration said last month it would not fight a court order that the photos be released by May 28. But Obama concluded he did not feel comfortable with the release, concerned they would inflame tensions in Iraq and Afghanistan and make the U.S. mission in those two wars more difficult, said White House press secretary Robert Gibbs.

Military commanders' concerns are most intense with respect to Afghanistan. The release would coincide with the spring thaw that usually heralds the year's toughest fighting there – and as thousands of new U.S. troops head into Afghanistan's volatile south.

The effort to keep the photos from becoming public represented a sharp reversal from Obama's repeated pledges for open government, and in particular from his promise to be forthcoming with information that courts have ruled should be publicly available.

As such, it was sure to invite criticism from people, including more liberal segments of the Democratic Party, that want a full accounting – and even redress – for what they see as the misdeeds of the Bush administration.

Federal appeals judges had ruled, in a Freedom of Information Act lawsuit filed by the American Civil Liberties Union, that the photos should be released, and the Justice Department had concluded that further appeal would probably be fruitless.

Last month, Gibbs said the president had concurred with Justice's conclusion, though without commenting on whether Obama would support the release if not pressed by a court case.

Thus, the Obama administration assured a federal judge  that it would turn over the material by May 28, including one batch of 21 photos and another of 23 images.  The government also told the judge it was "processing for release a substantial number of other images," for a total expected to be in the hundreds.

Gibbs emphasized that the president continues to believe that the actions depicted in the photos should not be excused and supports the investigations, prison sentences, discharges and other punitive measures that have resulted from them.

He said the new decision does not contradict Obama's promises of transparency, since details about investigations into the abuse are available on the Pentagon's Web site.

"The notion that somehow you don't know about these investigations because you haven't seen the photos doesn't make any sense," he said.

The ACLU, however, quickly lambasted Obama's move.

"The decision to not release the photographs makes a mockery of President Obama's promise of transparency and accountability," said ACLU attorney Amrit Singh, who had argued and won the case before the 2nd U.S. Circuit Court of Appeals in New York. "It is essential that these photographs be released so that the public can examine for itself the full scale and scope of prisoner abuse that was conducted in its name."

On Capitol Hill, the top Senate Republican welcomed the change. A military group also said it was relieved, because it feared terrorists would use the pictures as a recruiting tool.

"These photos represent isolated incidents where the offending servicemen and women have already been prosecuted," said Brian Wise, executive director of Military Families United. "There is no good that can come from releasing these photos."

The reactions were a reverse of what happened after Obama's decision last month to release documents that detailed brutal interrogation techniques used by the CIA against terror suspects. Those also came out in response to an ACLU lawsuit, and his decision then invited harsh and still-continuing criticism from Republicans.

This time he's kicking the decision back into court, where his administration still may be forced into releasing the photos.

Indeed, there is some evidence that the administration has little case left.

Gibbs said the president instructed administration lawyers to challenge the photos' release based on the national security implications of such a release. He said that argument was not used before.

"The president does not believe that the strongest case regarding the release of these photos was presented to the court," he said.

But the Bush administration already argued against the release on national security grounds – and lost.

"It is plainly insufficient to claim that releasing documents could reasonably be expected to endanger some unspecified member of a group so vast as to encompass all United States troops, coalition forces, and civilians in Iraq and Afghanistan," the three-judge appeals panel wrote in September 2008.

The court also has already rejected another argument Gibbs made, that the photos add little of value to the public's understanding of the issue.

"This contention disregards FOIA's central purpose of furthering governmental accountability," the appeals court panel concluded in the same decision.

Obama's own Jan. 21 memorandum on honoring the Freedom of Information Act also takes a different line than the administration did on Wednesday.

"The government should not keep information confidential merely because public officials might be embarrassed by disclosure, because errors and failures might be revealed, or because of speculative or abstract fears," it said.

The president informed Gen. Ray Odierno, commander of U.S. troops in Iraq, of his decision during a White House meeting on Tuesday.

Gen. David Petraeus, the senior commander for both wars, had also weighed in against the release, as had Gen. David McKiernan, the outgoing top general in Afghanistan.

Defense Secretary Robert Gates said he had once held the view that it might be best to "go through the pain once" and release a large batch of images now, since so many are at issue in multiple lawsuits. But he – and the president – had a change of heart when Odierno and McKiernan expressed "very great worry that release of these photographs will cost American lives," Gates said before the House Armed Services Committee.

"That's all it took for me," Gates said.

Photo: President Barack Obama