NEW YORK (CNNMoney.com) -- The Treasury Department and Federal Reserve on Sunday outlined a comprehensive government plan to prop up Fannie Mae and Freddie Mac - the two mortgage finance giants that play a crucial role in the U.S. economy.

Treasury Secretary Henry Paulson said the Bush administration plans to ask Congress to enact legislation to temporarily increase the line of credit that the companies have with the Treasury. It would also allow the Treasury to buy stock in the companies.

Paulson also said the Federal Reserve should be given a greater role supervising the finances of Fannie and Freddie.

In addition, the Federal Reserve announced Sunday that the mortgage finance companies can turn to the Federal Reserve Bank of New York for funds. The move gives Fannie and Freddie the same access to the funds as commercial banks and Wall Street firms. The agency granted investment banks such access earlier this year in the wake of a similar crisis of confidence when investors lost faith in Bear Stearns.

The decision by the government to step in comes at a tumultuous time for the two shareholder-owned companies, which own or back $5 trillion in home mortgages and are counted on to play a central role in the recovery of the battered housing market.

At issue is the companies' financial condition and whether their balance sheets are strong enough to continue their business of buying and guaranteeing home mortgages. The plan by the Treasury and the Fed would provide Fannie and Freddie with needed capital. Beyond that, even the promise of government support could be sufficient to calm investors.

Last week, investor concern sent shares of Fannie Mae (FNM, Fortune 500) and Freddie Mac (FRE, Fortune 500) plummeting. The selloff left shares of both firms down more than 45% for the week and about 75% for the year.

"Fannie Mae and Freddie Mac play a central role in our housing finance system and must continue to do so in their current form as shareholder-owned companies," Paulson said. "Their support for the housing market is particularly important as we work through the current housing correction," he added.

Provide crucial finance to housing markets

Fannie and Freddie provide a crucial source of funding for banks and other home lenders, especially since a credit market crisis last summer left them the only major players in packaging pools of mortgage loans into securities for sale to investors.

If they were unable to do so, it would raise the cost and restrict the availability of mortgage loans, causing more problems for already battered housing prices and sales. That in turn would be another significant problem for the overall U.S. economy, as well as global credit markets.

While investors have had doubts about Fannie and Freddie for years, the government is stepping in now because of the current heightened panic atmosphere on Wall Street.

"The market has its sights set on Fannie and Freddie," said Richard Yamarone, chief economist at Argus Research in New York. "With them in the target zone, the Fed and Treasury felt they had to act. [The agencies'] plan is being conducted to contain investors' fears from spreading to the rest of the market."

Sunday's announcement comes ahead of Monday's opening of the stock markets and a scheduled $3 billion debt sale by Freddie Mac.

"Now that you know you have the government's backing of these entities, that should go a long way to pacifying investor fears," Yamarone said.

The White House issued a statement Sunday evening urging Congress to act quicky - something that both Republican and Democrat leaders vowed to do.

Sen. Charles Schumer, D-N.Y., praised Paulson's plan. "While Fannie and Freddie still have solid fundamentals, it will be reassuring to investors, bondholders and mortgage-holders that the federal government will be behind these agencies should it be needed," he said. "The Treasury's plan is surgical and carefully thought out and will maximize confidence in Fannie and Freddie while minimizing potential costs to U.S. taxpayers."

In fact, the extent of their troubles is in debate. Several analysts and a former Federal Reserve governor have said last week that the two companies desperately need to raise money.

Others, including Fannie and Freddie, their regulators, some Wall Street analysts, and Sen. Christopher Dodd, D-Conn., the chairman of the Senate Banking Committee, have defended the strength of the two companies.

"What's important are facts - and the facts are that Fannie and Freddie are in sound situation," Dodd said on CNN's Late Edition on Sunday before the announcements by Treasury and the Fed. "They have more than adequate capital. They're in good shape."

Access to capital

Fannie Mae and Freddie Mac, in statements Sunday, reiterated their financial strength. "We continue to hold more than adequate capital reserves and maintain access to liquidity from the capital markets," the Fannie statement said.

A Freddie statement pointed to the upcoming release of its quarterly results. "We expect the results will also show that we have a much greater surplus above the statutory minimum capital requirement. The company's capital and liquidity resources will enable it to continue to serve its public mission as it has always done."

While they now have access to the Fed funds, the companies likely won't need to use the privilege at this time, said Art Hogan, chief market analyst at Jefferies & Co. in New York. But the move will give investors additional confidence that Freddie and Fannie can tap the pool of liquidity backed by the federal government.

Further, unlike the Fed's decision to let investment banks trade mortgage-backed securities for federal funds, the government is not taking on a lot of risk by letting Fannie and Freddie step up to the window.

"They have a very conservative pool of loans," Hogan said. "You know what you've got here. It's pretty bread-and-butter."