Once unthinkable, it is now inevitable: Fannie Mae and Freddie Mac will finish out President Obama's second term in the government's custody.

The demise of the two companies seemed certain when they were rescued by Uncle Sam during the subprime mortgage crisis and were the objects of sometimes heated protests.

But President Obama's sweeping Wall Street reform law in 2010 left the mortgage giants untouched. And efforts in Congress to shutter the companies, including a bipartisan, Obama-backed measure in the Senate, failed to gain traction amid disagreeements among lenders, investors, liberals and conservatives.

Over time, as they lingered under the government's caretaking, the two companies began turning profits and sending money to the Treasury. To date, Fannie and Freddie have turned over a quarter of a trillion dollars to the government.

Under an Obama-appointed administrator, the companies stopped shrinking their footprints and began preparing for a future in business, including breaking ground on new headquarters for Fannie Mae in downtown Washington, branching into new risk-sharing deals with investors, and putting money into affordable housing funds.

As a result, over the past few years, they have settled into a jury-rigged system of nationalized housing that most parties are basically OK with: Fannie and Freddie, as wards of the state.

They continue to sustain a secondary market for mortgages by buying loans from lenders, packaging them into securities and selling them to investors with a guarantee. Since the recession, the two have dominated the market, backing 44 percent of all new home loans, with the government as a whole backing more than 98 percent of mortgage-backed securities.

Yet although reforming Fannie and Freddie has fallen off the agenda and been forgotten, the situation is untenable and soon some sort of major changes will be unavoidable.

That's because, under current law, the two companies are scheduled to require a new infusion of cash from the Treasury by the end of the next president's first term, a development that once again will shake up the politics around housing finance and could prompt action.

So although Fannie and Freddie remain unfinished work, the next president will likely be forced to take action one way or another. Already, the endgame may be coming into sight.

Potential bailout

In early August, the Federal Housing Finance Agency, the government caretaker of the two government-sponsored enterprises, revealed the results of an exercise it had run to determine how much the two mortgage giants would lose in the case of another financial crisis.

The "stress test" showed that Fannie and Freddie would need a bailout of at least $49 billion and potentially as much as $126 billion, even assuming that the vast majority of the $5 trillion-plus in mortgages guaranteed by the two companies were left unscathed. In comparison, the two ultimately received nearly $188 billion following the 2008 crisis.

What such a bailout would mean for taxpayers is a tricky question, because of Fannie and Freddie's complicated financial relationship with the federal government.

Politically, however, there is little doubt that multibillion-dollar bailouts would stoke new controversy and provoke Congress into trying once again to get rid of Fannie and Freddie.

Bailouts also would remind the public that there was never the reckoning for Fannie and Freddie that the Wall Street banks went through.

"It's a huge unfinished piece of business," said David Stevens, head of the Mortgage Bankers Association. "When anybody talks about 'too big to fail' institutions, the banks pale in comparison to the trillions of dollars of international obligations that are held by these two institutions.

"Reforming Fannie and Freddie remains the last major piece of unfinished business of the financial crisis, and this news highlights the need for comprehensive housing finance reform," Sen. Bob Corker, R-Tenn., said in response to the stress test results.

Corker, a member of the Senate Banking Committee, is one of the authors of legislation that would have closed Fannie and Freddie and replaced them with a system in which government still stood behind mortgage securities, but investors took the first 10 percent of any losses. A version of the legislation cleared the banking panel in 2014, but never advanced to a floor vote.

If a bailout-weary public sees Fannie and Freddie getting a new round of government help, "the political status quo won't hold anymore," said Jim Parrott, a housing scholar at the nonprofit Urban Institute and consultant who previously served as a White House adviser on housing issues.

But a bailout is inevitable, under the terms of Fannie and Freddie's arrangement with the government, a legal relationship known as "conservatorship."

Fannie and Freddie are required to send all of their profits to the Treasury and they also have to gradually draw down the amount of money they have set aside to buffer against losses — a requirement put in place when it was thought they would only be in the government's hands for a short time before being reformed.

By 2018, that buffer will be gone, meaning that any downturn would necessitate taking funds from the Treasury. That would be in the middle of the next president's first term.

A downturn is likely. Although the two companies have been profitable in recent years, much of their success was attributable to one-off factors, such as money gained from crisis-era lawsuits and deferred tax assets. In fact, Freddie Mac posted a loss in the first quarter.

Mel Watt, the director of the FHFA, warned this year that the declining capital and the risk of investors or politicians panicking in reaction to a bailout is the "most serious risk and the one that has the most potential for escalating in the future."

More capital

The prospect of Fannie and Freddie requiring a bailout has led to calls from some groups for the government to allow them to build up capital, with their shareholders being the loudest.

While Fannie and Freddie stock is no longer traded on the major exchanges, they still have shares outstanding. For their investors, allowing them to be recapitalized and ultimately released from the government's clutches would be a major financial boon. It's a goal that investors, particularly large activist hedge funds, have sought politically and through the courts.

Support for letting the two companies rebuild capital cuts across ideological differences and party lines.

On the Right, some lawmakers and experts side with the investors who say the government is stiffing them or think that it would be prudent for the companies to build capital to avoid a bailout.

"It's essentially political malpractice" for Congress to stand by and let the federal government sweep up all of the companies' quarterly profits, as it currently does, said Clark Packard, government affairs manager for the National Taxpayers Union, a right-of-center nonprofit.

Packard favors legislation authored by Rep. Mick Mulvaney, a conservative from South Carolina, that would allow the businesses to rebuild capital and then leave the government's control. A number of conservative groups have backed the legislation.

The general idea of recapping and releasing Fannie and Freddie has cross-aisle appeal, with a sizable chunk of the House Democratic caucus calling on Watt to release them in June.

Liberals favor releasing them because affordable housing advocates mostly care only about keeping the current policies that boost low-income housing. That includes affordable housing trust funds that this year began sending money to the states, taken from a cut of the fees Fannie and Freddie charge on the guarantees they provide for mortgage-backed securities.

Watt, an Obama appointee and former Democratic congressman representing North Carolina, decided to have the government-sponsored enterprises contribute to the funds over the objections of congressional Republicans.

Rob Randhava, a senior counsel for the Leadership Coalition on Civil and Human Rights, said that he sees "potential" in the current system under Watt.

He fears that Congress, through doing nothing, will force Fannie and Freddie into a situation in which they need to draw funds from the Treasury, allowing a political opening for them to be eliminated. That strategy, he said, is "like playing chicken with the housing finance system."

Randhava's group was one of several housing advocacy and civil rights groups that wrote to Watt in late May asking him to allow Fannie and Freddie to keep their earnings, rather than pass them on to the Treasury, and ultimately to build capital and rejoin the private sector.

Watt wrote back in July with a cool response. Government custody of Fannie and Freddie is "not a desirable end state," he said, and "Congress needs to tackle the important work of housing finance reform."

The Obama administration has been more skeptical of "recap and release" for Fannie and Freddie. So have the Republican lawmakers who head the committees that oversee the companies. They oppose the government guarantee for mortgages that Fannie and Freddie supply.

Why it's unsustainable

From the perspective of the White House and key members of Congress such as Corker, returning Fannie and Freddie to the private sector would be wrong because it would allow them to perpetuate the system of private gain at public risk that led them into trouble in the first place, without taxpayers ever being adequately compensated.

Yet the status quo is also unsustainable in their eyes.

For now, Fannie and Freddie's guarantees of mortgage-backed securities generate the liquidity that makes it possible for homebuyers to get 30-year, fixed rate mortgages, a definitive characteristic of the U.S. housing market that is not prevalent in other countries.

The downside, however, is that the U.S. effectively has a nationalized system of housing finance and the problems that come with it.

Of those problems, the most notable is that Watt is put in the position of making decisions that should be determined by market forces and by competition among private companies.

One of the results most chafing for banks, as well as for members of Congress who represent minority districts, is that new rules on mortgages imposed in the wake of the crisis have constrained credit access, making it harder for some credit-worthy families to qualify.

Fannie and Freddie's own rules on which mortgages to buy exacerbate that problem, with the result that minorities, in particular, have found it harder to qualify for a home loan.

"It's much harder to get a mortgage than even in the normal years well before the build-up years to the crisis," said Ethan Handelman, vice president of the National Housing Conference, a nonprofit that joined the major bank groups in writing Watt urging him not to try to unilaterally change the government-sponsored enterprises absent legislation.

Running through all of the concerns with Fannie and Freddie is the fear that something even worse could replace them if Congress acts in a panic, as they might if they see them getting more bailouts.

"What we want to avoid is other overreactions or rapid reactions to Mel thinking he could do something unilaterally when it could cause Congress to react pretty swiftly," said David Stevens, head of the Mortgage Bankers Association.

Congress has been known to react quickly, in bipartisan fashion, to populist concerns about Fannie and Freddie. Last year, after Watt announced his plans to raise the salaries for executives at the company to attract talent, Congress passed legislation within months capping salaries at $600,000.

The fear is that they could do something hasty again in response to news of a bailout.

"I can imagine the headline. That would be terrible, even though it's entirely predictable," Handelman said. "The system's brittle. You could see a really bad overreaction."

The next administration

Yet the kind of legislative groundwork that should be getting done right now is not. And the 2016 candidates have ignored housing reform.

Neither Clinton nor Trump has mentioned Fannie and Freddie on the campaign trail. Clinton has talked about bolstering federal low-income housing spending but otherwise has remained silent on housing finance.

That has left banks, lenders, home builders and real estate agents to guess at what their intentions might be.

Trump is a blank slate. While he has placed blame on Fannie and Freddie for the financial crisis, he hasn't suggested any alternatives.

Nor does he have any advisers who have been involved significantly in housing finance, although one lobbyist did speculate that former Massachusetts Sen. Scott Brown, an early Trump endorser, might be in line for a top housing finance post.

Under Trump, however, the Republican platform became more hospitable to Fannie and Freddie's continued existence this year. While the 2012 platform called for eliminating the government-sponsored enterprises, this year it merely called for reconsidering their role, an ambiguous shift noted by several housing finance insiders.

With Clinton, the industry has more hints and clues to work with.

Two people who have advised her on housing, Parrott and former Obama top economic adviser Gene Sperling, contributed to a paper released in the summer that proposed a resolution for Fannie and Freddie.

They and their co-authors suggested that the two might be wound down and replaced with a government entity, called the National Mortgage Reinsurance Corporation. It would, in essence, be merging Fannie and Freddie and bringing them into the government.

Stevens described the plan as a possible "placeholder view" of a plan that could be viable in Congress.

Parrott described the plan as an effort to suggest a possible outcome that was not "a let's blow the system up and start over enterprise," but rather starting with the reality that Fannie and Freddie are entrenched.

It's a step away from the failed bipartisan effort in 2014 to wind down the companies and replace them with a system in which private investors would have been on the hook for the first 10 percent of losses on mortgage securities. That effort, led by Corker and Virginia Democrat Sen. Mark Warner, was "frankly too unnerving and dramatic" for lenders, he said.

Speaking at an event for home builders in August, Sperling suggested that, amid major disagreements about the role of the government in backstopping mortgages, Clinton's White House would seek to advance reform administratively.

The obstacle to administrative reform

One major obstacle is blocking any administration from making major unilateral changes to Fannie and Freddie, however. Investors in Fannie and Freddie shares, including major hedge funds such as Fairholme Capital, have sued the government in U.S. courts regarding the 2012 decision to sweep all profits to the Treasury rather than allow the companies to build up capital.

Potentially at stake in those suits, which have a losing record, are the hundreds of billions of dollars the government-sponsored enterprises have passed on to the Treasury since it announced in 2012 that it was amending the agreement to take in all profits.

Those funds have helped the Treasury over the past few years, as Republicans in Congress have put intense pressure on the administration to save money.

The government has relied on them as a "piggy bank," House Financial Services Democrat Michael Capuano remarked in a panel on housing at the Democratic National Convention in July.

Investors have decried the government's actions as a lawless profit grab and have pressed their case in news and social media. The administration has defended its move as within the law that set the parameters of the government takeover.

Without clarity on the outcome of those cases, the administration can't make major moves. But if the cases were decided and the Treasury gave him free rein, the director of the FHFA, an often obscure agency, could wield major sway over the mortgage industry.

Pagliara said that investors have made progress, if only by bringing more attention to their efforts. Although he favors recapitalizing and releasing Fannie and Freddie, he acknowledged that such a decision would be up to the administration. "Mel Watt is the one that holds the cards," he said.

Watt, or a successor, could go in the other direction, keeping Fannie and Freddie in conservatorship, cutting deals to have private investors take on risks for mortgages, and selling the technology for bundling mortgages for sale.

That, of course, is the exact outcome that the government-sponsored enterprises' top opponents also want to avoid.

In July, Corker and Warner sent Watt a letter dissuading him from any administrative action that would pave the way for eventually releasing the companies. "It is my hope that Director Watt will avoid any measures that would hinder the ability to pass bipartisan reform legislation in the future," Corker said.

As added insurance, they and other lawmakers attached a bill to legislation funding the government last September, ensuring that the government couldn't sell its stake in Fannie and Freddie for two years.

Congress has at least until then to pass legislation, with Fannie and Freddie in limbo.