WASHINGTON (Reuters) - The U.S. Treasury and Federal Reserve on Sunday unveiled sweeping steps to support Fannie Mae and Freddie Mac if needed to bolster confidence in the troubled mortgage financing giants and head off a potential meltdown in global financial markets.

The headquarters of mortgage lender Fannie Mae is shown in Washington in this file photo from October 3, 2006. REUTERS/Jason Reed/Files

In moves that could mean a major escalation in U.S. taxpayer exposure, the Fed said the companies could access its discount window for emergency cash. The Treasury separately said that it would temporarily increase its line of credit to the two, as well as purchase equity in them, if needed.

The move by the Fed echoed its emergency action to help rescue investment bank Bear Stearns in March, when it opened the discount window to investment banks for the first time since the Great Depression.

“(Their) continued strength is important to maintaining confidence and stability in our financial system and our financial markets. Therefore, we must take steps to address the current situation as we move to a stronger regulatory structure,” Treasury Secretary Henry Paulson said in a statement that he read on the steps of the Treasury building.

A senior Treasury official said all the actions it proposed need Congressional approval, but expressed confidence that could be secured within this week.

Charles Schumer, Democratic Senator for New York, praised the plan and said that it should boost investor confidence in Fannie Mae and Freddie Mac, both shareholder-owned but government-sponsored enterprises whose shares have plummeted.

The dollar edged higher against the euro and the yen on the news, which came before a crucial sale of $3 billion in 3- and 6-month notes by Freddie Mac on Monday.

Stock futures also gained in relief at this muscular evidence of official U.S. support which follows a battering week on Wall Street.

Shares in the two companies, which own or guarantee just under half of the country’s $12 trillion in mortgage debt, have been hammered by concerns that they might run out of capital amid mounting home-loan losses.

Chief executive Daniel Mudd said in a statement that Fannie Mae holds more than adequate capital reserves and has access to liquidity from capital markets. He also said that having options to access provisional liquidity if needed would strengthen market confidence.

Fannie Mae and Freddie Mac buy mortgages from lenders and package them into guaranteed securities sold around the world, providing more funds to keep mortgage markets lubricated.

The two companies play a vital role in U.S. housing markets, which already are experiencing their deepest downturn since the Great Depression, and Treasury and the Fed are on the spot to make sure they do not put a sorely stressed financial system in worse shape than it is already in.

Many fear that were they to fail it would unhinge already suffering world financial markets and inflict a deep recession in the United States that would chill growth everywhere.