BP has won an agreement from the Justice Department that there will be no penalties on the barrels of crude oil the company was able to recapture during the 2010 Gulf of Mexico spill, effectively cutting the company’s potential Clean Water Act fines by as much as $900 million, or even up to $3.5 billion.

The volume of oil spilled into the Gulf of Mexico has been a matter of intense dispute, hinging on estimates of flow rates. The government has asserted that the blowout on the Macondo exploration well, which killed 11 people and sank the Deepwater Horizon drilling rig, caused a spill of 4.9 million barrels.

BP has contended that the amount spilled was “at least 20 percent” less than that. Moreover, it has argued that whatever the size of the spill, it kept 810,000 barrels out of the water by capturing the oil with its containers and vessels. That would mean that civil penalties would apply only to 3.1 million barrels of oil.

Even using the government’s higher estimate, the agreement to exclude the 810,000 barrels would reduce BP’s Clean Water Act fines by 16.5 percent.

“These issues are extremely complicated as a technical matter, and there is still further analysis to do,” Rupert Bondy, BP’s group general counsel, said in a statement. “But it is clear, based on our analysis so far, that the government’s public estimate is simply wrong and overstated by at least 20 percent.”

Billions of dollars could be riding on the difference. Under the Clean Water Act, the federal government can impose fines of as much as $1,100 a barrel or, if BP is found to be grossly negligent, as much as $4,300 a barrel.

BP is going to trial in a New Orleans federal court Monday to defend itself against charges of gross negligence. The size of the spill will be the subject of the second phase of the trial, beginning in September.

BP stressed in a statement that the statutory fines are maximum fines and that the court could decide to impose smaller penalties based on the company’s $23 billion effort to clean up the damage from the spill.