The fact that this week's $13 billion JPMorgan settlement was a record between a U.S. company and the government is not the most notable part of this deal…

What's more shocking about this record-high settlement is that more than half of it could be tax-deductible.

Under terms of the $13 billion deal, JPMorgan Chase & Co. (NYSE: JPM) will pay $4 billion toward consumer relief. The remaining $9 billion goes to settle federal and state civil claims stemming from entities involved in the mortgage securities. The state of New York will receive $613.8 million, California $298.9 million, Illinois $100 million, Delaware $19.7 million, and Massachusetts $34.4 million, according to the Department of Justice.

Included in the $9 million is a $2 billion non-tax-deductible fine to the Department of Justice.

But the rest – $7 billion – is tax-deductible thanks to part of the tax code that states costs associated with corporate legal cases can be treated similarly to a company's wages or equipment expenses.