NEW ORLEANS — In the four years since the blowout on the Deepwater Horizon oil rig killed 11 workers and sent millions of barrels of oil gushing into the Gulf of Mexico, BP has spent more than $28 billion on damage claims and cleanup costs, pleaded guilty to criminal charges and emerged a shrunken giant.

But the company has maintained that it was not chiefly responsible for the accident, and that its contractors in the operation, Halliburton and Transocean, should shoulder as much, if not more, of the blame.

On Thursday, a federal judge in New Orleans for the first time rejected those arguments, finding that BP was the primary culprit and that only it had acted with “conscious disregard of known risks.” He added that BP’s “conduct was reckless.”

By finding that BP was, in legal parlance, grossly negligent in the disaster, not merely negligent, U.S. District Judge Carl Barbier opened the possibility of $18 billion in new civil penalties for BP, nearly quadruple the maximum Clean Water Act penalty for simple negligence and far more than the $3.5 billion the company has set aside.

Unlimited Digital Access. $1 for 4 weeks.

The ruling stands as a milestone in environmental law given that this was the biggest offshore oil spill in U.S. history, legal experts said, and serves as a warning for the oil companies that continue to drill in the Gulf of Mexico, where high pressures and temperatures in the wells test the modern drilling technologies.

The decision casts a cloud over BP’s future. Its reputation has already been sullied, and important holdings in Russia are at risk because of tensions in Ukraine.

In addition to the $28 billion in claim payments and cleanup costs it has paid, BP has been forced to divest itself of more than 10 percent of its oil and gas reserves, along with valuable pipelines and refining facilities to pay claims and increase its profitability.

BP shares fell by nearly 6 percent Thursday, closing at $44.89, reducing the company’s market value by almost $9 billion.

In a statement, BP said it “strongly disagrees with the decision” and would immediately appeal to the 5th U.S. Circuit Court of Appeals.

While Barbier did find the other companies had acted with negligence, he concluded that only BP, which leased the well and was in charge of the operation, was grossly negligent. He apportioned 67 percent of the blame for the spill to BP, 30 percent to Transocean and 3 percent to Halliburton.

The company’s ultimate civil liability is far from determined.

The ruling Thursday only pertains to the first phase of a federal civil trial, concerning the responsibility of the blowout itself. The next phase, scheduled to start in January, will lead to a final determination of total penalties under the Clean Water Act.

BP faces still another set of potential penalties, under the federal Oil Pollution Act of 1990. David Uhlmann, a University of Michigan law professor and former chief of the Justice Department’s environmental-crimes section, said those claims could cost BP more than $10 billion.

Material from The Associated Press is included in this report.