The U.S. government is stepping in to shore up troubled mortgage giants Fannie Mae and Freddie Mac.

Treasury Secretary Henry Paulson has unveiled a three-part plan designed to keep the firms from facing a full-scale government bailout. In a statement release Sunday, he stressed that the firms must stay as public companies. “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,” he said.

He also indicated that their continued operation is important, both as the U.S. housing market corrects, and to maintain confidence and stability in the financial system and the financial markets.

The plan includes a temporary increase in the line of credit the firms have with the Treasury, to ensure liquidity; temporary authority for the Treasury to purchase equity in either of the two firms if needed to ensure they have sufficient capital; and, beefed up oversight by the Federal Reserve.

“To protect the financial system from systemic risk… the plan strengthens the GSE regulatory reform legislation currently moving through Congress by giving the Federal Reserve a consultative role in the new GSE regulator’s process for setting capital requirements and other prudential standards,” he said.

Paulson noted that he consulted with the Fed, the Securities and Exchange Commission, the Office of Federal Housing Enterprise Oversight and Congressional leaders to develop the plan.

At the same time, the board of governors of the Fed announced that it has granted the Federal Reserve Bank of New York the authority to lend to Fannie Mae and Freddie Mac “should such lending prove necessary”.

“Any lending would be at the primary credit rate and collateralized by U.S. government and federal agency securities. This authorization is intended to supplement the Treasury’s existing lending authority and to help ensure the ability of Fannie Mae and Freddie Mac to promote the availability of home mortgage credit during a period of stress in financial markets,” the Fed said in a release.