The government officials said that the more drastic alternative that has been considered  placing one or both companies under the control of a government-appointed conservator  would be done only as a last-ditch measure if the intermediate steps failed to restore confidence. The failure of just one of the companies could be catastrophic for economies around the world.

Image Treasury Secretary Henry M. Paulson Jr. announced a plan Sunday to help shore up Fannie Mae and Freddie Mac. Credit... Joshua Roberts/Reuters

The officials said they were prompted to act because, despite repeated assurances by top officials that the companies had adequate cash to weather the current financial storm, Fannie and Freddie suffered a withering blow of confidence last week when their stocks plummeted on the New York Stock Exchange. As a result, Freddie faced an uncertain debt offering on Monday.

The companies, known as government-sponsored enterprises, or G.S.E.’s, touch nearly half of the nation’s mortgages by either owning or guaranteeing them, and the debt securities they issue to finance their operations are widely owned by foreign governments, pension funds, mutual funds, big companies and other large institutional investors.

“G.S.E. debt is held by financial institutions around the world,” Mr. Paulson said in his statement. “Its 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.”

The proposal would give the Treasury secretary authority to determine when to invest in the companies or extend loans to them. Those purchases would be made with the agreement of the companies.

Officials said the proposed investment and lending elements of the plan were to last two years.

While the Treasury did not specify the size of the packages, officials briefed on the plan said they were told by administration officials that, to be meaningful, Congress should consider extending the line of credit to the two institutions to $300 billion.

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 loans valued at more than $5 trillion, about half the nation’s mortgages.