WASHINGTON  Alarmed about the sharply eroding confidence in the nation’s two largest mortgage finance companies, the Bush administration will ask Congress to approve a rescue package that would give the government the authority to buy billions of dollars in stock in Fannie Mae and Freddie Mac and also lend to the companies to meet their short-term funding needs, people briefed about the plan said on Sunday.

Separately, the Federal Reserve voted on Sunday to also open a lending facility for Fannie Mae and Freddie Mac, if they need emergency capital. The two companies would be able to post their own securities as collateral.

The plan calls on Congress to give the government the authority over the next two years to buy an unspecified amount of stock in the two companies. Over the same period of time, it would permit the companies to have greater access to the Treasury, by expanding the credit line that each company has from the Treasury. Each company now has a $2.25 billion credit line, set nearly 40 years ago by Congress. At the time, Fannie had only about $15 billion in outstanding debt. It now has total debt of about $800 billion, while Freddie has about $740 billion.

Today the two companies also hold or guarantee mortgages valued at more than $5 trillion.

As part of the plan, the administration will also call on Congress to raise the national debt limit, people briefed on the plan said. And it will ask Congress to give the Federal Reserve a role in setting the rules for how big a capital cushion each company must hold. Giving the Fed a consulting role in the companies’ oversight is seen as yet another way to reassure nervous markets.