Two years after blowing up and requiring a $45 billion taxpayer life preserver, Citigroup (NYSE: C) is inches away from freeing itself from the government.

The Treasury announced yesterday that it priced to sell its remaining 2.4 billion common shares in a deal to be completed by the end of the week. The sale price, $4.35, is slightly below the current market price, but still a great deal considering the size of the offering.

Treasury will receive $10.5 billion from the sale. Combined with previous sales, taxpayers have so far booked a cumulative $12 billion profit from the Citigroup ordeal. Here's how it breaks down:

Current Common Stock Sale

$10.5 billion

Previous Common Stock Sales

$21.3 billion

Trust Preferred Repayment

$2.2 billion

Targeted Investment Program Repayment

$20 billion

Interest and Dividends

$2.9 billion

Total Proceeds

$57 billion

Total Amount of Bailout

$45 billion

Profit

$12 billion

Source: Treasury.gov.

The final profit will likely be even higher. Taxpayers still own warrants on 465 million shares of Citigroup common stock, and the Federal Deposit Insurance Corp. holds $800 million worth of preferred stock that will be remitted to the Treasury if there are no losses on a debt backstop provided by the FDIC.

For Citigroup shareholders, this is a benefit in that major indexes like the S&P 500 hadn't considered the Treasury's ownership stake when weighting Citigroup's stock to various indexes. With the Treasury's stake being released into the private market, Citigroup's relative weighting will increase, meaning large institutional investors like index mutual fund and ETFs will essentially be forced to buy.

For taxpayers, the repayment is an obvious win. Many awful things can be said about TARP. It was moral hazard on speed. It was unfair. It went against capitalism. It was crooked. It was an inside job. All mostly true. But what TARP was not, empirically, was costly -- especially the money used to bail out banks. The Congressional Budget Office estimates TARP's final cost is now $25 billion, substantially all of which stems from either AIG, homeowners assistance plans, or the auto bailouts. TARP money put into banks has actually generated a $22 billion gain. "Clearly, it was not apparent when the TARP was created two years ago that the cost would turn out to be this low," says the CBO. To realize how true that statement is, try and think back to early 2009. The big question back then was whether Citigroup would make it to the next day. That a mere 18 months later we're talking about a sizable profit for taxpayers is truly remarkable, regardless of how you felt about the bailouts from an ideological perspective.

For the broader banking industry, this is a win in that it helps remove part of the taint associated with government interference. Every other big bank, including Bank of America (NYSE: BAC), JPMorgan Chase (NYSE: WFC). Wells Fargo (NYSE: WFC), and Goldman Sachs (NYSE: GS), are already free of TARP's restraints. With Citi largely free of the shackles, the large-cap banking industry is now essentially free of direct taxpayer engagement.

Is there a downside to the repayments? At least one, yes. The fact that TARP's banking assistance ended up being a profitable venture makes it more likely to be repeated in the future -- a sense of moral hazard in itself, if you will. Had the program ended up costing the $700 billion originally believed, it would be political nitroglycerine, so viciously hated that there would be zero chance of an encore. That's still largely the case -- TARP has been incredibly unpopular from the beginning -- but come the next financial crisis, don't be surprised to hear the words "It worked well last time, so we're going to do it again" come out of Washington.