NEW YORK (CNNMoney.com) -- Among the nightmares lurking around the corner for the already battered housing and credit markets would be a meltdown at mortgage financing giants Fannie Mae and Freddie Mac.

Although few are predicting an imminent need for a bailout just yet, credit rating agency Standard & Poor's recently placed an estimated price tag on this worst case scenario -- $420 billion to $1.1 trillion of taxpayer's money.

This dwarfs how much it cost to help banks during the savings and loan crisis of the late 1980's and early 1990's. That cost taxpayers about $250 billion in today's dollars.

S&P added that saving Fannie (FNM) and Freddie (FRE, Fortune 500) might cost so much that the federal government's AAA credit rating, the top possible rating, might even be at risk. If that was lost, then all federal government borrowing would become more expensive.

Fannie Mae and Freddie Mac both help the mortgage market function by purchasing pools of loans and packaging them into securities.

So it is crucial for the mortgage industry for the two agencies to continue functioning smoothly.

The two companies are known as government-sponsored entities because they have Congressional charters, which implies that the federal government is behind them.

Fannie did not comment about the S&P report. According to a statement from Freddie, the firm said the S&P report was just "a scenario analysis, not a prediction" and added that "Freddie Mac remains a well capitalized company."

Victoria Wagner, a S&P credit analyst who worked on the report, said S&P isn't predicting that Fannie and Freddie would necessarily need a bailout at this time.

But she and other analysts are concerned about the impact more problems could have on the mortgage market since the two companies have become increasingly important to the health of the industry. Both companies are forecast to report more losses this year due to declining home prices and rising mortgage defaults.

Risks increasing

Wagner pointed out that at the end of January, 82% of all mortgages in the U.S. were backed by one of the firms, up from only 46% in the second quarter of 2007.

Fannie and Freddie primarily back so-called conforming loans, those made to borrowers with good credit and large down payments. But even limited exposure to subprime loans hasn't stopped them from running up huge losses as home prices tumbled and foreclosures soared.

And Fannie and Freddie's role in the mortgage and real estate markets is likely to grow, as Congress recently allowed them to back larger mortgages, up to $729,750, up from the previous limit of $417,000.

The Office of Federal Housing Enterprise Oversight (OFHEO), which regulates both firms, also recently lowered the capital requirements for Fannie and Freddie in an effort to pump $200 billion more into the credit markets.

The new loan limits will increase the risks and losses for Fannie and Freddie, said Wagner and other experts.

The high priced markets where homeowners and buyers need larger loans are now the ones seeing steep home price declines. And the default rates on larger loans are greater than the smaller loans that had previously been the core of their business.

"I don't think the message is a bailout is necessary or imminent," Wagner said. "But they're facing this increased role at a time that their own credit performance is suffering from the rifts in the housing and mortgage markets. They're both projecting much higher losses than we've seen in some time."

Some see bailout as more likely

But other experts expect that declining home values will force more borrowers who have a Fannie- or Freddie-backed loan to stop making payments in the coming months, rather than continuing to make payments on a home now worth less than their loan balance.

Rising job losses may also make it difficult for other borrowers who formerly had good credit to stay current on their mortgage payments.

"The real fundamental problem is real estate prices have been falling and they might fall substantially more," said Robert Shiller, a Yale University economist who argued for years that a bubble was forming in real estate prices. "OFHEO and Fannie and Freddie never considered the possibility of a massive real estate correction."

Some economists suggest that if investors start to see problems in the performance of loans backed by Fannie and Freddie, they'll dump them. And that would force the federal government to step in.

"I would say there's at least a 50-50 chance of some sort of bailout. I'm not saying it will necessarily cost $1 trillion, but they'll need some kind of help, and it very well could happen this year," said Dean Baker, co-director of the Center for Economic and Policy Research

Investors are signaling growing concern as well. The yield premium for securities backed by Freddie and Fannie compared to the yield on Treasury bills has grown to about 2.25 percentage points from 1.7 percentage points at the beginning of the year. That's a sign that the investors see a greater risk of Fannie and Freddie running into bigger problems.

And OFHEO, in its annual report this week, said that while Fannie and Freddie have made progress clearing up accounting problems that had dogged both firms, they remain "a significant supervisory risk."

The agency added that since current home price declines are without precedent, the firms will have a difficult time correctly pricing the risk of the mortgages they're backing.

But Jaret Seiberg, financial services analyst for policy research firm Stanford Group, said Fannie and Freddie ultimately should be able to weather the storm though simply because there is no question that the government would bail them out.

So there shouldn't be a crisis of confidence about their future in the way that there was for investment bank Bear Stearns before the Fed stepped in and agreed to back $29 billion in potential losses so JPMorgan Chase (JPM, Fortune 500) could buy Bear Stearns (BSC, Fortune 500).

"What has allowed Fannie and Freddie to continue to operate when the private mortgage-backed security market dried up is their implicit government guarantee," said Seiberg.