District Judge Alvin Hellerstein rejected government arguments that the images would provoke terrorists and incite violence against troops in Iraq.
He ordered the defence department to release 74 photos and three videos provided by Sergeant Joseph Darby, some of which were leaked last year and set off the Iraqi prisoner abuse scandal, potentially opening the military up to more embarrassment from a scandal that stirred outrage around the world.
Among Sergeant Darby's pictures already published was the image showing Private Lynndie England with a naked prisoner on a leash. England was sentenced to three years in jail for her part in the scandal. It is not known if this picture or other well-known images are among those being contested.
The written ruling came in response to a Freedom of Information Act suit filed in 2003 by civil rights groups, including the American Civil Liberties Union (ACLU), over treatment of detainees in Iraq, Afghanistan and Guantanamo Bay.
The judge had ordered the release of the photographs in June, but the defence department appealed against the decision, telling the judge in oral arguments that releasing the pictures could incite more violence among insurgents in Iraq.
Judge Hellerstein said that terrorists "do not need pretexts for their barbarism" and that suppressing the pictures would amount to submitting to blackmail.
"Our nation does not surrender to blackmail, and fear of blackmail is not a legally sufficient argument to prevent us from performing a statutory command," he said.
The judge said that withholding the photographs, which show American soldiers forcing prisoners "to pose in a manner that compromised their humanity and dignity", would be contrary to the democratic freedoms that American troops were fighting for.
"Indeed, the freedoms we champion are as important to our success in Iraq and Afghanistan as the guns and missiles with which out troops are armed," Judge Hellerstein said. "As President Bush said, we fight to spread freedom so the freedoms of Americans will be made more secure."
In his order the judge said releasing them was in the public interest because their publication would initiate debate on the conduct of American soldiers and about the US Army's command structure, poor training and lack of supervision.
The judge gave the government 20 days to appeal before releasing the pictures, which are edited so that the faces of prisoners are not shown.
General John Abizaid, commander of US Central Command, said that releasing the photographs would hinder his work against terrorism. "When we continue to pick at the wound and show the pictures over and over again it just creates the image - a false image - like this is the sort of stuff that is happening anew, and it's not," General Abizaid said.
Amrit Singh, a lawyer for the ACLU, said the ruling was a victory for government accountability. "The government cannot continue to hide the truth about who is ultimately responsible for the systematic abuse of detainees from the American public," she said.
The ACLU contends that prisoner abuse is systemic.
"It's a historic ruling," said the ACLU's executive director, Anthony Romero. "While no one wants to see what's on the photos or videos, they will play an essential role in holding our government leaders accountable for the torture that's happened on their watch."
All senior commanders have so far been cleared of any crime. Nine junior soldiers have been convicted, with some serving jail sentences.Reuse content