The bailout of the financial system is roughly as popular as Wall Street bonuses, the federal budget deficit or LeBron James in a Cleveland sports bar. You hear over and over that the bailout was a disaster, it cost taxpayers a fortune, we didn’t really need it, it didn’t work, it was a failure. It has become politically toxic, which inhibits reasoned public discussion about it. ¶But you know what? The bailout, by the numbers, clearly did work. Not only did it forestall a worldwide financial meltdown, but a Fortune analysis shows that U.S. taxpayers are also coming out ahead on it — by at least $40 billion, and possibly by as much as $100 billion eventually. This is our count for the entire bailout, not just the 3 percent represented by the massively unpopular Troubled Assets Relief Program. Yes, that’s right — TARP is only 3 percent of the bailout, even though it gets 97 percent of the attention. ¶A key reason for the rescue’s profitability is that the Federal Reserve System has already turned over more than $100 billion of bailout-related income to the Treasury, and it’s on track to turn over $85 billion more this year and next. That’s not something most people include in their math. On the negative side, we’re including

what may be the first overall cost calculation of a special tax break that’s worth tens of billions of dollars to four big bailout recipients. And, of course, we’ve analyzed reports from the Congressional Budget Office, the Treasury, the Federal Deposit Insurance Corp. and other sources.

We’ll get to the detailed numbers in a bit. But for now, we’d like to remind you why the bailout exists. The revisionist idea that the bailout is the problem — rather than excesses in the financial system — is simply stunning to those of us who watched the financial crisis surface in 2007, when two Bear Stearns hedge funds speculating in mortgage securities collapsed, and then reached a crescendo in September 2008, when Lehman Brothers went bankrupt. Many in the financial world applauded Washington’s decision to let Lehman go under — but that applause was quickly replaced by fear as unanticipated consequences of the bankruptcy surfaced.

Lehman’s collapse touched off a terrifying run on money-market mutual funds when the Reserve Primary Fund announced that it could pay holders only 97 cents on the dollar because of Lehman-related losses. Savers who’d considered money funds as safe as federally insured bank deposits stampeded for the exits, pulling out hundreds of billions of dollars. It took federal guarantees of more than $3 trillion of money-market fund balances — bailout! — to stop this modern-day bank run.

Some hedge funds that used Lehman’s London office as their “prime broker” had their assets frozen, setting off a run on prime brokers Goldman Sachs and Morgan Stanley as U.S. hedge funds pulled out their assets to avoid getting frozen if either firm failed. Goldman and Morgan were close to running out of cash when the government saved them by making them bank companies with access to the Fed’s lending facilities. Bailout! Bailout! GE Capital was having trouble rolling over its borrowings and was rescued by a government guarantee program. Bailout! Then there was American International Group, the now infamous AIG, which required a 12-figure rescue.

Had Goldman, Morgan Stanley, GE Capital, AIG and several giant European banks not received bailouts and instead failed, even capital-rich J.P. Morgan Chase would have gone under because it wouldn’t have been able to collect what these and other players owed it. There would have been trillions of dollars in losses, worldwide panic, missed payrolls and quite likely the onset of the Great Depression II. That’s why we needed a bailout. And why we got it.

Now that we’ve relived the history, let’s take a stroll through the numbers. Things have turned out far better than expected because the massive government intervention calmed the markets, and Uncle Sam had to make good on only a tiny fraction of the obligations that taxpayers guaranteed. Uncle Sam bought assets at what turned out to be near-bottom prices during the market panic; the value of Sam’s holdings has since soared. The more than $14 trillion of government investments, securities purchases, and loan guarantees — of which TARP never amounted to more than $411 billion (although it was authorized to spend up to $700 billion) — stabilized the whole financial system.

So how has this worked out for U.S. taxpayers?

The costs

l The biggest expense by far comes from the rescue of mortgage finance giants Fannie Mae and Freddie Mac. Or, actually, the rescue of their debtholders — stockholders have been essentially wiped out.

The $130 billion cost is the money the government has put into Fannie and Freddie ($154 billion) to cover their losses, less the dividends ($24 billion) Fannie and Freddie have paid on the government’s preferred stock. The Treasury and the nonpartisan Congressional Budget Office both expect that $130 billion figure to shrink; Fannie and Freddie have been adding profitable business since 2008, which should begin to outweigh their losses from the housing bubble. But we’re being conservative and counting the full $130 billion.

l Then there’s a $35 billion tax expense, which no one else has included in bailout calculations. It’s our analysis (with assistance from tax guru Bob Willens) of the taxpayer cost of special IRS rulings that allowed TARP recipients AIG, Citigroup, General Motors and Ally Financial (formerly GMAC) to use their tax losses in full, rather than being subject to “change in control” rules designed to stop companies from being taken over for their tax losses. GM got both an IRS ruling and a provision in the 2008 economic stimulus legislation to preserve its losses despite having gone bankrupt.

We estimate that without special treatment, the companies could have used only about $4 billion of their $43 billion of “deferred tax assets” to offset federal income taxes. Now they can use them all. We’re estimating the taxpayer cost at $35 billion rather than the full $39 billion because it’s not clear when — or whether — the companies will earn enough to use all the losses. (The tax breaks have presumably increased the prices of the shares in those companies that the government owns or has sold because they have made the companies more valuable to investors. That means the higher share prices have decreased the cost of the bailout, though it’s impossible to quantify by how much.)

l We’re counting the cost of TARP as $19 billion, based on the most recent update by the Congressional Budget Office. That includes $13 billion spent to help homeowners restructure their mortgages, plus projected losses on AIG, GM and Chrysler, offset by gains in some of TARP’s other holdings, primarily in banks. The $19 billion estimate is a big improvement from the CBO’s first estimate, $189 billion, in January 2009. That’s because TARP’s investments have fared better than expected, and its total outlays have been shrinking rapidly. They’re down to $104 billion, according to the Treasury, from their aforementioned high of $411 billion.

On the plus side

The biggest and most surprising numbers are the bailout-related profits that the Federal Reserve has turned over to the Treasury — and that we expect it to turn over this year and next.

We’re counting these payments as an offset to the bailout’s cost because they stem from the Fed’s bailout activities. The Fed’s increased profits come primarily from income on the $1.25 trillion of mortgage-backed securities it bought in 2008-09 to stabilize credit markets (Quantitative Easing 1), and the $600 billion of Treasury securities it bought in 2010-11 (QE2) to hold down interest rates and raise asset values. Even though QE2 is usually considered “economic stimulus,” we’re treating it as part of the bailout because rising asset values have helped stabilize the financial system.

The Fed now owns almost $2 trillion more of securities than it did before financial problems surfaced in 2007. A normal financial institution would have had to borrow heavily to add $2 trillion of assets, and interest on that borrowed money would have offset most or all of the income from the added assets. The Fed, though, doesn’t have to borrow: It effectively creates money (which has its own problems) to buy the securities. So the Fed’s income on its added securities is pure profit.

Each year, the Fed turns over most of its annual profit to the Treasury. It’s money that the Treasury can spend, and it reduces the federal budget deficit. From 2007 (when the Fed began expanding its balance sheet to combat financial instability) through 2010, the Fed sent a total of $193 billion to the Treasury. In the previous four years, it sent the Treasury only $91 billion. We’re counting that $102 billion difference as bailout-related profit.

Most Fed analysts expect the size of the Fed’s securities portfolio (and hence its profits) to fall slowly, if at all, this year and next. So we’re estimating that the Fed will send $55 billion of bailout-related profits to the Treasury this year, about what it sent in 2010. To be conservative, we’re estimating the 2012 bailout profit at only $30 billion.

l The Treasury owns 563 million shares of AIG that it got from the Fed, which extracted them from the insurance giant in 2008 in return for making $85 billion of credit available. Even though AIG was a big TARP recipient, this holding, currently worth about $16 billion, isn’t included in TARP’s profit-and-loss statement. That’s why we’re including it here.

l The Treasury says it has made a total of $15 billion from fees for insuring money fund balances and from the $150 billion of mortgage-backed securities it owns.

l We estimate that the FDIC has made $8 billion from the difference between the fees it has charged to guarantee borrowings and the losses it has incurred on those guarantees. The FDIC declined to give us a number because some of the guarantees are still outstanding.

The bottom line

Our accounting is unconventional because in some places we count what has happened, in some places we project what’s likely to happen, and in some places we’ve done our own numbers because no others exist. If things break right, taxpayers could come out $100 billion ahead: our $42 billion profit estimate, plus a $25 billion reduction in the Fannie/Freddie cost, $25 billion more in Fed profits, and a reduction in the $19 billion expense we’re showing for TARP.

We don’t expect any of what we’ve told you to make the bailout popular — we’re not wild about it ourselves for the same reasons many people dislike it. The government was picking winners and losers. Big Government bailed out Big Finance while letting average taxpayers lose their homes. Creditors of bank companies and AIG got far too good a deal at taxpayer expense. Wall Street is back to paying enormous bonuses (and whining about being demonized), while average Americans, whose tax dollars saved the Street, are still suffering. And, of course, the economy is down 7 million jobs from its peak in 2007.

But something needed to be done when the financial world was on the brink of the abyss, and the government did something. You should be happy that taxpayers, almost miraculously, are coming out ahead rather than hundreds of billions of dollars behind.

When our boss assigned us to find out how much the financial rescue cost, we expected to find a monumental loss because Fannie Mae and Freddie Mac seemed like a bottomless pit. Instead, we discovered that bailout profit payments from the Fed — which we hadn’t previously thought of as a profit center — are virtually certain to exceed taxpayer losses on Fannie and Freddie. We were surprised — and pleased — to discover taxpayers showing a profit on the bailout. We hope that you are, too.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.

To pause and restart automatic updates, click "Live" or "Paused". If paused, you'll be notified of the number of additional comments that have come in.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.