In effect, the decision by a three-judge panel of the United States Court of Appeals for the Second Circuit means it will be months before there is any chance that the Defense Department could be ordered to release the photographs.

Amrit Singh, a lawyer for the American Civil Liberties Union, which is seeking the release of the photographs as part of a Freedom of Information Act lawsuit, said she was disappointed by the court’s ruling. “It will only serve to delay further the release of these photographs, which are critical for informing the ongoing public debate about the treatment of prisoners,” she said.

Ms. Singh said the photos portrayed abuse in Afghanistan and Iraq in places other than Abu Ghraib prison, the Iraq jail made infamous in 2004 by photographs of abuse there, and would therefore show that abuse was “not aberrational but systemic.”

The photo issue is just one of several that are likely to generate opposition to the bill, which would also set aside $7.7 billion to prepare for a flu pandemic, provide $1 billion to encourage consumers to trade in older cars for more fuel-efficient models and allow detainees at the Guantánamo Bay, Cuba, center to be brought to the United States for trial.

The measure also clears the way for a $100 billion line of credit for the International Monetary Fund, which was the initial source of trouble for the spending bill. Republicans strongly supported the spending legislation when it was considered this year, but have threatened to withhold their support over the foreign aid, saying some of the money could go to unfriendly governments.

With Republicans abandoning the measure, Democrats need as many votes as they can win over and the ban on releasing the photos emerged as a major obstacle. In the meeting of House and Senate negotiators late Thursday afternoon, efforts to reinstate the ban were beaten back.