In a ruling issued in New York yesterday, US federal judge Alvin Hellerstein gave the government two months to decide how to respond to his order before the photos could be released.
The case has been brought by the American Civil Liberties Union which argues the release of the photos is necessary for an "ongoing national debate about governmental accountability for the abuse of prisoners."
The US government has opposed the release of the photos on the grounds they could provoke a violent backlash and place US forces and personnel overseas at heightened risk of attack.
However in yesterday's ruling, Hellerstein said the US government had provided insufficient justification for attempting to block the release of the photos under the 2009 legislation.
Also Read
"I found that the certification remained deficient because it was not sufficiently individualised and it did not establish the (defense) secretary's own basis for concluding that disclosure would endanger Americans," Hellerstein wrote.
The exact number and content of the photos in question is unclear. A government brief filed earlier in the court case said several photos showed "soldiers pointing pistols or rifles at the heads of hooded or handcuffed detainees."
Between 2004 and 2006, 11 soldiers - including Lynndie England, who was seen smiling beside naked prisoners being subjected to sexual abuse - were convicted in court martials.
The ACLU was not immediately available to comment on the court ruling today.
Pentagon spokesman Lieutenant Colonel Myles Caggins said the Defense Department was "studying the judge's ruling and will make any additional responses through court filings.