WASHINGTON - Congressional negotiators reached tentative agreement on Thursday on a $105.9 billion spending measure that would provide money for military operations in Iraq and Afghanistan through September but would drop a ban on the release of photographs showing abuse of foreign prisoners held by United States forces.
The deal was concluded after Rahm Emanuel, the White House chief of staff, went to the Capitol to assure Senate Democrats that President Obama would use all administrative and legal means to prevent the photos' release. At the same time, a federal court issued a ruling effectively ensuring that the photos would not be released for months, if ever.
Mr. Obama followed up with a letter, promising to work with Congress if legislation was necessary to keep the photos from being publicized but urging lawmakers not to let the dispute interfere with freeing up the money for the armed forces.
"Given the singular importance of providing funding for our troops, it is essential that Congress pass the supplemental appropriations bill," Mr. Obama wrote in the letter, which was read publicly at the negotiating session by Senator Daniel K. Inouye, Democrat of Hawaii and the Appropriations Committee chairman.
The photo restriction, approved by the Senate, was viewed by some Democratic House members as an end run around federal freedom of information laws. It was dropped to appease Democrats already uneasy about approving nearly $80 billion for combat and more money for aid to Afghanistan and Pakistan.
Democrats said they could not secure enough votes to pass the bill if the photo ban were included. But Republicans threatened to try to block the measure if the ban were cut out, saying the photos could incite terrorists and endanger Americans overseas.
"What good are we to our soldiers if we can't protect them in a time like this?" asked Senator Lindsey Graham, Republican of South Carolina. "Every photo is a bullet for our enemy."
He and his allies, including Senator Joseph I. Lieberman, independent of Connecticut, said Mr. Obama should take executive action to block the release of the photos by ordering them classified.
The administration's cause was bolstered when a federal appeals court in New York announced last Thursday that it had granted a request by the Obama administration and recalled its April 27 order to release the photographs, permitting the administration to take the case to the Supreme Court.
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.
Some lawmakers also questioned including $1 billion to encourage owners of older cars to trade them in for more fuel-efficient models. That program, known as Cash for Clunkers, is nominally aimed at helping the environment and reducing carbon emissions, but many lawmakers who pushed for it were primarily interested in lifting vehicle sales to prop up the struggling auto industry.
The provision had not originally been included by either the House or Senate. And critics, mainly Republicans but also some Democrats, charged that it was a brazen giveaway of tax dollars to bankrupt auto companies that had already received billions in federal bailout assistance. But an effort to eliminate the money was defeated.
The bill also includes $8 million to pay for a new commission to examine the causes of the financial and economic crisis.
Scott Shane contributed reporting.