The judge says the administration overreached in implementing the six-month halt. As an appeal is planned, the Interior secretary says he will issue a new order to justify the ban.

Reporting from Atlanta and Washington — A federal judge on Tuesday struck down the Obama administration's six-month moratorium on deep-water drilling in the Gulf of Mexico and suggested the federal government acted "arbitrarily and capriciously" in imposing the halt.

The 22-page order by U.S. District Judge Martin L.C. Feldman amounted to a stinging rebuke of a central element of the Obama administration's response to BP's oil leak in the Gulf of Mexico. A White House spokesman said the administration would file an immediate appeal.

The ruling comes at a time when little is going the president's way. The oil is still leaking, the economy is still bad and to top it off, President Obama may be on the brink of firing Army Gen. Stanley A. McChrystal, the commander running the war in Afghanistan, over comments published in a magazine article.

Worse, the ruling undermined one of the main claims of the Obama administration: that it is thoughtful and deliberate in all things. "The plaintiffs have established a likelihood of successfully showing that the administration acted arbitrarily and capriciously in issuing the moratorium," the judge wrote.

In announcing an appeal, White House spokesman Robert Gibbs said, "The president strongly believes, as the Department of Interior and the Department of Justice argued yesterday, that continuing to drill at these depths without knowing what happened … potentially puts the safety of those on the rigs and safety of the environment in the gulf at a danger that the president does not believe we can afford right now."

Mixed reaction from within the president's own party underscored the challenge facing Obama as he tries to revamp national energy policy.

Sen. Mary L. Landrieu (D-La.) said she would urge the administration not to appeal the ruling but to find a way to achieve its goal of ensuring safety without harming her state's fragile economy.

Another Louisiana Democrat, Rep. Charlie Melancon, said the ruling was "encouraging" for Louisianans whose jobs depend on the oil and gas industry and expressed hope that Obama wouldn't fight it.

"As long as the administration is appealing the decision, the future of energy production in the gulf remains unclear," he said. "I hope the president will stand with the thousands of Louisiana families who have spoken loudly with one voice about the dangers this moratorium poses to our economy and order his administration not to appeal today's decision."

But Sen. Frank R. Lautenberg (D-N.J.) called the ruling "incredibly shortsighted," given that oil is still gushing into the gulf. Sen. Patty Murray (D-Wash.) added, "We shouldn't even consider putting our environment, our economy, or our workers at risk on deep-water drilling projects until we know what caused this tragedy in the Gulf Coast, and until we understand exactly how to prevent anything like it from ever happening again."

A vigorous challenge of the ruling may cheer environmentalists, but it puts Obama on one side of what David DiMartino, a former Democratic Senate aide working with a pro-environment coalition, describes as "a division between folks who stand with Big Oil and folks who don't."

That could create political problems for a president who has tried to straddle that divide, and who is hounded by criticism that he has been unresponsive to the nationwide unemployment crisis.

Though not faulting Obama, some environmentalists fretted Tuesday over the perception of presidential impotence in the face of tragedy.

"What does it say about our system that even the president of the United States can't pause Big Oil's dangerous deep-water drilling?" Larry Schweiger, president and chief executive of the National Wildlife Federation, said in a statement.

The decision was cheered by the oil industry and the workers whose paychecks depend on the deep-water rigs. Louisiana officials estimate the moratorium would have eliminated about 11,000 jobs from their state.

"It's a good thing they stopped that because we were going to lose a lot of jobs," said Nacis Theriot of Galliano, La., owner of a small fleet of oil industry crew boats. "The majority of your big oil companies would leave … and we would all suffer."

In coastal Lafourche Parish, parish spokesman Brennan Matherne said the decision helped the community dodge a proposed 40% budget cut that would have resulted from lost tax revenue generated by the oil and gas industry. "The whole community breathed a sigh of relief," he said.

Feldman's order granted a preliminary injunction to the plaintiffs in the case, a group of oil services support companies headed by Hornbeck Offshore Services, a Covington, La.-based marine company.