BP’s settlement deal Friday night puts the oil company one giant step closer to containing the gusher of damage claims that arose from the massive Gulf of Mexico oil spill. But BP still faces one major hurdle: the federal government.

The settlement with private plaintiffs, which BP estimates will cost $7.8 billion, will resolve more than 100,000 individual and business claims — from shrimpers to vacation condo owners — through a court-supervised process that will last at least until April 22, 2014.

But the Justice Department is seeking stiff civil penalties — and weighing criminal charges — over the April 20, 2010, blowout at BP’s Macondo well that killed 11 people, set fire to and sank the Deepwater Horizon drilling rig, and spilled millions of barrels of crude oil into the gulf. If the government can prove BP is guilty of “gross negligence,” it would ratchet up the civil fines to nearly four times the level it would levy otherwise.

In addition, attorneys general for Gulf Coast states, in coordination with Justice, are pursuing economic and environmental claims against BP and the service companies that were involved in drilling the Macondo well. Alabama Attorney General Luther Strange said in a statement Saturday: “We are fully prepared to try our case, and we hope that the court sets a new trial date in the near future.”

For now, stock market analysts welcomed the news of the settlement with private plaintiffs.

Oppenheimer & Sons oil analyst Fadel Gheit said BP’s $7.8 billion estimate “is slightly above half the circulated figure of $14 billion.” He said the settlement is “very positive for BP and could speed up government settlement and remove this dark cloud that has been hanging over BP for two years.”

Pavel Molchanov, an oil analyst with the firm Raymond James, said he had expected the case to go to trial. “This lifts much of the legal overhang, though not all of it,” he said.

“If this is not a manifestation of BP’s financial strength, I don’t know what is,” Molchanov added. “They are drawing a line under Macondo so they as a company can play offense again rather than defense.”

There is some uncertainty about the size of the settlement reached Friday night, the culmination of intensive talks held in hotels, law offices and corporate conference rooms in New Orleans, London and Washington since December.

What BP and the Plaintiffs’ Steering Committee agreed to — subject to approval by U.S. District Judge Carl Barbier in New Orleans — is a process with formulas for payouts. BP, based in part on its own experience paying claims through the Gulf Coast Claims Facility, has estimated the total cost but there is no financial cap on its obligations.

“What we agreed to was ultimately a blank-check formula,” plaintiffs’ attorney Stephen J. Herman said in an interview Saturday. “So the cost depends on how many people are out there and how well it works. It’s not that there’s a pot of money for $7.8 billion; . . . it’s priceless in a sense.”

The settlement allows a class of people and businesses to seek compensation for economic or medical damages. The process will resemble and replace the one run by the Gulf Coast Claims Facility, which was established by BP and led by lawyer Kenneth Feinberg, who was chosen and paid by BP. During a 30- to 45-day transition period, claims pending at the GCCF will be moved to the new court-supervised mechanism. Those awaiting payments can get the promised amount or seek more in the new process.

“We recognize that Mr. Feinberg was put in a very challenging situation, and he made the best of it,” Herman said. “He played the cards as well as he could, but now we have a new deck. In a simple sense it’s a claims process, but we think it’s going to be very different in the way it’s administered.”

The settlement money will be drawn from what’s left in the $20 billion escrow account, or trust fund, BP established in 2010 to pay claims and fines. If BP’s estimate is right, the fund would have $3.4 billion that could be used to pay the federal and state governments without forcing BP to take any charge against earnings beyond the $37 billion it has taken already.

With the private plaintiffs’ demands met, BP can focus on settling with the federal and state governments. It could be difficult.

“We do not use words like ‘gross negligence’ and ‘willful misconduct’ lightly, but the fact remains that people died, many suffered injuries to their livelihood, and the Gulf’s complex ecosystem was harmed as a result of BP and Transocean’s bad acts or omissions,” the Justice Department said in a pretrial memorandum filed Feb. 7.

By BP’s reckoning, it should pay about $3.5 billion. It arrived at that figure using its own estimate for the rate at which oil leaked into the gulf during the 87-day spill offset by the amount of oil collected by skimming and burning at the surface. Under the Clean Water Act and Oil Spill Pollution Act, the company would be fined at least $1,100 a barrel.

The government’s figures for the spill are higher and if it can prove that BP was guilty of “gross negligence” in causing the spill, the fines could shoot up to $4,300 a barrel for a total of about $17 billion.

A criminal indictment would open up a host of other issues, raising new threats to BP and challenges for Justice. “The standard is so much higher,” said Carl Tobias, a professor at the University of Richmond Law School. He said Justice would have to prove its case “beyond a reasonable doubt versus a preponderance of the evidence” needed in a civil case.

“It’s just difficult to win those criminal cases,” Tobias said. But he said whatever Justice decides “is the next big piece.”