The government is going hard after misbehaving banks, collecting billions of dollars more in fines this year than it did last year.
Banks have agreed to fork over more than $17 billion in settlements with U.S. regulators so far in 2013. That's up from a little over $10 billion in 2012. And that doesn't include the $8 billion that JPMorgan Chase may get hit with soon.
The year's biggest settlement came late Friday, when JPMorgan Chase agreed to pay Fannie Mae and Freddie Mac $5.1 billion for bad mortgages it sold them. Since profits from those two firms eventually go to the Treasury in the form of dividends, most of that money will go to the government.
Out of the $17 billion total, almost $9 billion will go to homeowners who were victims of illegal foreclosure practices. Most of the rest of the money will end up in the Treasury Department's general fund, which pays for everything from national parks to air traffic controllers and military forces.
There is one wrinkle though - virtually all the fines are tax deductible. So when the feds collect a fine, whether it's $1 million or $1 billion, the bank will have a lower tax bill. The upshot: Treasury isn't really collecting all of that fine money.
Here's a breakdown of the banking industry's misdeeds and the big payouts that have resulted:
Related: JPMorgan to pay nearly $1 billion in 'London Whale' case
JPMorgan Chase (JPM) was already writing big checks this year, before the latest settlement hit. Over the last five weeks, it agreed to pay $800 million to U.S. regulators to settle charges related to last year's "London Whale" trading debacle.
Also in September, it was ordered to refund $309 million to customers and pay $80 million in fines to resolve unfair credit card practices. In July, JPMorgan agreed to pay $410 million to settle charges it manipulated electricity markets in California and the Midwest.
But the bank, which is the nation's largest with assets of $2.5 trillion, can afford these hefty penalties - it's set aside $23 billion to handle all of its legal costs this year.
Related: Banks to pay billions in new foreclosure settlement
Some of the biggest payouts this year came as mortgage servicers agreed to settle charges of improper foreclosure practices. Eleven institutions agreed to settlements totaling $8.8 billion, including Bank of America (BAC), Citigroup (C) and Wells Fargo (WFC).
Related: JPMorgan paying $5.1 billion over mortgages
The government has also collected hefty sums this year from other banks that sold bad mortgages to Fannie Mae and Freddie Mac.
In addition to JPMorgan's $5.1 billion deal, UBS (UBS) agreed to pay $885 million. Citigroup and the finance arm of General Electric (GE) also reached settlements for undisclosed amounts.
And the agency that oversees Fannie and Freddie has cases pending against more than a dozen other lenders over similar accusations.
Related: More banks under scrutiny in Libor probe
The scandal surrounding the London Interbank Offered Rate, or Libor, has generated yet more fees for the U.S. government. It first came to light in June of 2012 that numerous banks were manipulating the rate to make money on their trading desks. British bank Barclays (BCS) and Swiss bank UBS paid out nearly $2 billion in fines.
In February, Royal Bank of Scotland (RBS) agreed to pay $475 million, and the U.K.-based brokerage ICAP agreed to pay the Commodities Futures Trading Commission $65 million in a similar matter.
On Tuesday, Dutch lender Rabobank agreed to pay $800 million for Libor violations.