NEW ORLEANS (AP) -- BP and five Gulf states announced a record $18.7 billion settlement Thursday that resolves years of legal fighting over the environmental and economic damage done by the energy giant's oil spill in 2010.

The settlement will likely mark the end of major litigation against BP, following the biggest offshore oil spill in U.S. history. When the Deepwater Horizon oil rig exploded in April 2010, it killed 11 people and spread miles of black oil across the Gulf Coast before the underwater well was capped a few months later.

The settlement, if accepted by a federal judge, would end a years-long battle between BP and the U.S. government over Clean Water Act penalties after a judge ruled the company was grossly negligent in the nearly 134 million gallon spill.

It would resolve the states' natural resources damage claims and settle economic claims involving state and local governments in Florida, Alabama, Mississippi, Louisiana and Texas, according to an outline filed in federal court.

"If approved by the court, this settlement would be the largest settlement with a single entity in American history; it would help repair the damage done to the Gulf economy, fisheries, wetlands and wildlife; and it would bring lasting benefits to the Gulf region for generations to come," U.S. Attorney General Loretta Lynch said in a statement.

The oil spill wreaked economic and environmental havoc across the Gulf Coast states, affecting animals like dolphins and birds, and hurting oyster, shrimp and fish catches.

Governors and attorneys general from four of the five states to receive money from the settlement announced it during simultaneous news conferences just as a court filing was made public.

The court filing was a confidentiality order that gave broad outlines of the deal. It did not go into specifics and barred the parties from doing so.

Louisiana Attorney General Buddy Caldwell said the agreement ends litigation that could have dragged on for years, delaying the state's ability to repair and rebuild its coast and wetlands.

"Today's settlement is a game-changer for Louisiana, its communities and its families," Caldwell said. But he cautioned that the finer details remain to be worked out in a final consent decree he expected to be complete in about two months.

Louisiana received the largest share of the settlement money - about $6.8 billion.

Alabama Attorney General Luther Strange called the settlement a "home run," and he and Gov. Robert Bentley said they believed a looming jury trial was a significant factor in reaching the settlement.

Financial analysts congratulated BP CEO Bob Dudley and Chief Financial Officer Brian Gilvary during a conference call Thursday, and investors cheered the move, pushing BP shares up 5 percent in midday trading.

While the payout is larger than BP had provisioned for, the company's Clean Water Act fines are less than they could have been. Plus, the payout is scheduled over so many years that BP will be able to pay investors a dividend and have enough financial flexibility to make deals and pursue large production projects. Dudley said during the conference call that he could see as many as 20 major new projects by 2020, depending on oil prices.

"This allows us to manage BP as an oil company," Dudley said.

BP said the cumulative charge associated with the spill, before taxes, would rise to $53.8 billion from $43.8 billion at the end of March.

Those costs so far include an estimated $14 billion for response and cleanup and $4.5 billion in penalties announced after a settlement of a criminal case with the government. It remains unclear how much BP will end up paying under a 2012 settlement with individuals and businesses claiming spill-related losses.

The credit rating firm Fitch said the deal will "considerably strengthen" BP's credit profile and would likely lead to an upgrade of the company's rating.

Under the settlement, BP will pay $5.5 billion in penalties under the Clean Water Act. That's much lower than the $13.7 billion penalty BP was facing in an ongoing case.

But the company will also have to pay $7.1 billion to fix natural resource damage along with close to $5 billion more for the states to settle economic and other claims. Payments are to be spread over as many as 18 years.

David Uhlman, a University of Michigan law professor and former chief of the Justice Department's environmental crimes section, said BP benefits in that the natural resource damage and economic claims are tax deductible - the Clean Water Act claims are not - and because payments are spread out.

But, he said, the states are likely get more money from the settlement than they would have under what promised to be years of litigation.

Environmental groups remained concerned the settlement didn't go far enough.

Raleigh Hoke, campaign director for the Gulf Restoration Network, said the organization worried how much of the money promised for coastal restoration would actually go there. That's a key concern in Louisiana, which has been hurt by decades of coastal erosion that has made it even more at risk to hurricanes and rising ocean levels.

In Mississippi, officials said some of the money would cover projects including restoration of marshes and artificial reef habitats. In Louisiana, officials planned to use money for coastal restoration, as well as wetlands and wildlife habitat repair.

Jacqueline Savitz, U.S. vice president for Oceana, a group dedicated to protecting the world's oceans, said the $18.7 billion still paled in comparison to what BP should pay. Pointing to the $13.7 billion that they might have faced in Clean Water Act penalties alone, she said it could - and should - have been more costly for the oil giant.

"We're settling for much less than what the American public deserves," she said.

More From KROC-AM