U.S. President Barack Obama has reversed his position on releasing photos showing prisoners in Iraq and Afghanistan being abused.

U.S. President Barack Obama is seeking to block the release of hundreds of photos showing prisoners in Iraq and Afghanistan being abused, reversing his position after military commanders warned that the images could stoke anti-American sentiment and endanger U.S. troops.

The pictures show mistreatment of detainees at locations beyond the infamous U.S.-run Abu Ghraib prison in Iraq.

Word of Obama's decision on Wednesday came after top military commanders in Iraq and Afghanistan expressed fears that publicizing the pictures could put their troops in danger.

When the Abu Ghraib photos emerged in 2004 of grinning U.S. soldiers posing with detainees, some naked, some being held on leashes, they caused a huge anti-American backlash around the globe, particularly in the Muslim world.

Obama decided he did not feel comfortable with the photos' release, and was concerned it would inflame tensions in Iraq and Afghanistan, put U.S. soldiers at higher risk, and make the U.S. mission in those two wars more difficult, according to White House officials.

White House press secretary Robert Gibbs told reporters that the president was concerned that the photos' release would pose a national security threat, an argument the administration has not made yet in the courts.

"The president does not believe that the strongest case regarding the release of these photos was presented to the court and that was a case based on his concern about what the release would do to our national security," Gibbs said.

Gibbs said that the main argument previously was a privacy one.

A sharp reversal

The move 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 the more liberal segments of the Democratic Party that want a full accounting — and even redress — for what they see as the misdeeds of previous years under former Republican president George W. Bush.

Federal appeals judges ruled in September 2008, in a Freedom of Information Act lawsuit filed by the American Civil Liberties Union, that the photos should be released. After those losses in federal court, the U.S. Justice Department concluded that any further appeal would probably be fruitless.

Last month, Gibbs said the president had concurred.

Through an arrangement with the court, the Pentagon was preparing to put out, by May 28, two batches of photos, one of 21 images and another 23. The government had also told the judge it was "processing for release a substantial number of other images." The total number of photos to be released was 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 fully supports the investigations, prison sentences, discharges and other punitive measures that have resulted from them. But that is not likely to quiet Obama's critics.

Critics decry Obama's decision

Indeed, the ACLU 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 argued and won the case in front of the 2nd U.S. 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 Republican welcomed the move.

"I agree with the president that the release of these photos would serve no purpose other than to put our troops in greater danger," said Senate Minority Leader Mitch McConnell of Kentucky. "The president made the right decision, and I applaud him for it."

The president last week instructed administration lawyers to challenge the release in court and to make the case that the national security implications of such a release have not been fully presented, the official said.

Commanders fear for troops' safety

Pentagon spokesman Geoff Morrell said U.S. military "commanders are concerned about the impact the release of these photos would have for the troops in Afghanistan and Iraq," and that U.S. Defence Secretary Robert Gates shares their concerns. Gates wanted the photos blocked from release or at the very least delayed, Morrell said.

Military commanders' concerns are most intense with respect to Afghanistan.

There the release would coincide with the spring thaw that usually heralds the year's toughest fighting. Morrell also noted the release as scheduled would come as thousands of new U.S. troops head into Afghanistan's volatile south.

Since the circuit appeals court both ruled against the government and denied its request for a followup hearing, the case could now land at the Supreme Court.