NEW ORLEANS — A federal judge has ruled BP does not have to pay for economic losses other businesses suffered when the federal government shut down deep-water drilling in the wake of BP’s catastrophic 2010 oil spill in the Gulf of Mexico.

U.S. District Judge Carl Barbier issued his ruling late Thursday.

The Obama administration imposed a six-month drilling ban in the Gulf to prevent another disaster. The offshore industry called the moratorium a costly mistake.

Barbier’s ruling came in a lawsuit brought by six companies involved in offshore drilling, but plaintiffs’ lawyers said thousands of similar claims worth billions of dollars would be affected by the decision.

The case centered on whether BP was liable under the Oil Pollution Act for the loss of business caused by the moratorium.