Corporations continue to use big civil legal settlements with federal regulators as a way to deduct billions of dollars from their American tax bills, largely because the regulators fail to forbid the practice in the terms of the settlements.

BP’s pending $20.8 billion settlement with the Justice Department and other federal and state regulators related to the Deepwater Horizon oil spill in 2010 allows about $15.3 billion to be classified as a tax-deductible business expense, according to an analysis by the United States Public Interest Research Group, a nonprofit advocacy group.

Likewise, the Justice Department’s $25 billion mortgage settlement with Bank of America, JPMorgan Chase, Wells Fargo, Citigroup and Ally Financial in 2012 — billed at the time as the largest consumer financial protection settlement in United States history — allowed $20 billion to be eligible as a deduction for those banks.

U.S. PIRG analyzed the 10 largest settlements by five federal regulators since 2012, six of them bank settlements in the aftermath of the financial crisis.