When Victor Vidales drives past the vacant homes that dot South Phoenix and Laveen, his concerns are now very different from two years ago. Instead of fearing irredeemable blight in the sprawling suburbs of the Arizona capital, he is wondering whose hands the houses are in and when they will put them on the market.

For Mr Vidales, a real estate agent who kept plugging away through the depths of the foreclosure crisis, the trouble is now the shortage of homes for sale, the clamour from buyers and the soaring valuations that threaten to price ordinary families out of the market.

“There are multiple offers on everything and it is hard even to get buyers in to see houses,” he says. “Values are escalating much quicker than we ever wanted or expected.”

From bombed out to booming in two years, the story is echoed around many other big cities, where double-digit percentage increases in house prices are transforming more than neighbourhoods and family finances. They are also transforming the health of financial institutions that have a claim on American homes – and none more surprisingly than the vilified mortgage finance giants Fannie Mae and Freddie Mac.

Five years after their bailout, Fannie and Freddie have gone from apparent basket cases threatening to be a drain on the taxpayer for years to come to sources of income that have helped push back by months the date when the US Treasury will hit its next debt ceiling.

The result is that there is now a vicious argument over who has a claim to the robust profits from Fannie and Freddie. Investor lawsuits threaten a long-delayed political effort to wind down the two companies and reform the US government’s role in housing finance. Investors, politicians and analysts are even starting to imagine something that was unthinkable a short while ago: perhaps Fannie and Freddie will live to fight another day.

Last month Fannie Mae reported net income of $10bn for the second quarter. Freddie Mac reported $5bn. Most of those profits will be handed to the US Treasury in the coming weeks, taking the running total to $146.2bn. In a few more quarters, the taxpayer will have taken more in dividends from the two companies than the $189.4bn it had to pump in to keep them afloat.

Theirs was the biggest bailout of the financial crisis and one of the riskiest because the Treasury essentially wrote Fannie and Freddie a blank cheque. They were deemed too big – and too central to the supply of mortgage credit in the US – to be allowed to fail.

The two companies buy the majority of home loans and package them for sale to investors, freeing up lenders to make more new loans even during market downturns. Fannie Mae’s history stretches back to President Franklin D Roosevelt’s New Deal. Although they were private companies with shares traded on the stock market, making $8.6bn in net income between them in 2005, their federally chartered public mission gave them a quasi-governmental status. Collectively they are known as the government-sponsored enterprises, or GSEs, and they have always been contentious.

Critics say that they used their implicit backing from the US Treasury to get cheap funding for reckless investments, including subprime mortgages.

When mortgage defaults rose and the value of their housing collateral crashed, losses spiralled and the government put Fannie and Freddie into the “conservatorship” of a regulator in September 2008, exactly one week before the failure of Lehman Brothers. The US Treasury promised to pump in cash in return for senior preferred shares. Existing common shareholders and preferred stock holders were pushed to the bottom of the queue. With red ink expected to run into the hundreds of millions of dollars, those investors appeared to have been wiped out.

But even in 2008, not everybody agreed about that.

“I bet on America,” says Tim Pagliara, founder of CapWealth Advisors in Franklin, Tennessee. He put about $9m of his clients’ money into Fannie and Freddie preferred stock in late 2008 and early 2009, as the financial crisis was at its worst. “I made an assessment that people were overreacting. I bet on the housing market. I don’t make any apology for that.”

Mr Pagliara was eventually joined by other investors speculating that there might one day be enough profits rolling in to Fannie and Freddie to restore value to the preferred shares, or even to the common equity.

Perry Capital, an $8.7bn hedge fund built by Goldman Sachs alumnus Richard Perry, began buying preferred shares in 2010, and Bruce Berkowitz’s Fairholme Fund put 6.9 per cent of its assets into Fannie and Freddie this year. Both the preferred shares and the common equity jumped in value.

The investment thesis was this: that the GSEs have taken far more bailout cash than they will eventually need to cover their cash losses.

Fannie and Freddie did need the money in 2008. Accounting rules require them to assess likely future losses and set aside reserves to cover them, and it was clear they did not have enough. But the amount depends on assumptions about how many borrowers will default and, crucially, what house prices will be when the company puts a foreclosed home on the market. The assumptions used since 2008, in hindsight, underestimated how quickly house prices would revive.

It turns out the money can come back out of reserves, and be recorded as profit – $5.4bn for Fannie alone in the second quarter.

When President Barack Obama was in Arizona on August 6, he called for the GSEs to be wound down and replaced, complaining that in private hands they had been allowed to make huge profits buying mortgages, knowing that if their bets went bad “taxpayers would be left holding the bag”.

Ralph Axel, interest rates strategist at Bank of America Merrill Lynch, took up the metaphor in a note to clients. “As Fannie and Freddie continue to produce strong earnings,” he wrote, “the bag taxpayers are holding is quickly filling up with cash.”

Mr Pagliara is considering joining one of the lawsuits. Essentially the cases are challenging the way the Treasury has run the GSEs. Investors are angry about an arrangement called a “sweep” under which all the new profits are being funnelled to taxpayers in the form of dividends on the senior preferred stock.

The sweep was not in the terms of the 2008 bailout. The Treasury was originally paid a 10 per cent dividend on its investment, which at first led to the bizarre situation where it had to give Fannie and Freddie more money, simply so they could pay it straight back out again. In August last year, just as they were returning to the black, it was decided that the Treasury would sweep in all future profits they made.

The profit transfers are still called dividends rather than repayments, so the companies remain perpetually in the Treasury’s debt. They cannot build capital to pay the government back or to return value to investors down the chain.

Lawyers for the preferred shareholders don’t call it a sweep. They call it a heist.

Senator Bob Corker scoffs at that characterisation. “Fannie and Freddie wouldn’t be making one penny of revenue if the federal government was not standing behind them, not one penny, so it is a silly discussion,” he says, when asked about the lawsuits. As creations of Congress, their fate should be decided there not in the courts, he argues. “Fannie and Freddie haven’t generated a return for taxpayers. The taxpayers have generated this return for the taxpayers. Without their federal charter they would have zero value, not one penny of fees could they be generating right now. Not one penny. I can’t say that too many times.”

The senator is behind a bipartisan bill to wind down the GSEs and replace them with a new system for supporting the mortgage market, this time one that makes the government backstop explicit but which also tries to attract more private money to share the risk in downturns.

The Corker-Warner bill and Mr Obama’s comments in Arizona have put GSE reform on the political agenda after a five-year hiatus, although the politics would be fraught even without the risk that the current conservatorship could be rewritten by the courts.

A system with private investors having to shoulder losses ahead of the government could mean higher mortgage rates for homebuyers, critics say. There is also the risk of disruption to the $1.3tn-a-year market for GSE-issued mortgage-backed securities, which are widely held by investors around the world because they are seen as akin to risk-free Treasury securities.

Under the conservatorship of the Federal Housing Finance Agency, the GSEs have already introduced tougher underwriting standards, curtailed their more speculative investment arms and started to seek loss-sharing deals with the private sector, potentially expunging many of their pre-crisis excesses.

The preferred shareholders certainly want a seat at the table as the reform is debated. Perry Capital’s attorneys and advisers – from Ted Olson, solicitor-general under President George W Bush, to Tony Fratto, a former White House deputy spokesman – are political insiders and the firm has sought meetings on Capitol Hill to argue that a system without the GSEs would be more expensive for homeowners. It says taxpayers would be best served by returning them to private hands and promoting extra competition.

If big hedge funds are not obviously sympathetic participants in the debate, then the Independent Community Bankers of America – representing an estimated 300 local banks that still hold preferred shares – might provide a friendlier face.

“Our official position is that the rightful owners of Fannie and Freddie are the preferred shareholders,” says Paul Merski, head of congressional relations at the ICBA. “Conservatorship is a weird animal, but we would want the preferred shareholders to be made whole to the extent possible if Fannie and Freddie are evolving and becoming profitable.”

Senator Corker hopes that the arrival of lawsuits from Perry Capital and Fairholme will help rather than hinder reform. “No doubt they will try to foul things up as they go along but the fact they have filed their suit has added some energy to this process. It has raised people’s antennas, people around Washington feel pressure building to try to keep the status quo.”

Comments from Senator Harry Reid, the majority leader, though, suggest that Fannie and Freddie may still have friends on the Hill. “These are the government organisations that have made home ownership so easy,” Mr Reid said this month after the president called for their winding-up. “I don’t agree with the president. He says he wants to get rid of them. I think we’d better be very, very careful doing that.”

Analysts are now wondering if the consensus to liquidate Fannie and Freddie will hold. “The reform debate has already started to change,” says Mr Axel of Bank of America. “We think support may soon build for small tweaks rather than a full overhaul, especially if the housing market continues its recovery.”

…

Fannie, Freddie and the American dream

By taking control of Fannie Mae and Freddie Mac five years ago, the US government took the companies back to their roots.

Fannie Mae – formally the Federal National Mortgage Association – was created by the Roosevelt administration in 1938 when the country was mired in the Great Depression, originally as a government agency that would buy mortgages from the private sector. The hope was that it would get thrifts and insurers lending once again.

The company was only privatised in 1968 to get its debts off the government’s books amid the escalating cost of the Vietnam war. Freddie Mac was created at the behest of Congress in 1970 to develop a securitisation market that would increase the availability of mortgages.

Both companies, now with outside shareholders eager for dividends, became tools of successive administrations keen to push the goal of home ownership. Showered with tax and regulatory favours, they grew to dominate US mortgage finance – and then kept growing.

From Lyndon B Johnson’s 1968 restructuring of Fannie Mae onwards, the companies were given ever wider mandates to lower the cost and expand the availability of mortgage credit. The pair were among the biggest donors to politicians, justifying their increasing reach by pointing to neighbourhoods transformed and families lifted out of poverty by home ownership.

An accounting scandal in 2003 was, in retrospect, a hint of trouble to come, when it was revealed that both companies had hidden the volatility of their expanding operations through bookkeeping tricks. The scandal shone a light on the lavish pay packages of Fannie and Freddie’s chief executives and their power on Capitol Hill.

Yet both continued to expand not just their traditional business of buying, packaging and selling mortgages, but also their own investment operations called “retained portfolios”, which invested in subprime and other mortgage securities.

By the end of 2007 the two owned or guaranteed mortgages and mortgage securities totalling $5tn, including $1.5tn held on their own books, all in the name of aiding the housing market and promoting the American dream.