David O. Maxwell, who took over the Federal National Mortgage Association a decade ago when it was losing $1 million a day and transformed it into a profitable financial powerhouse, yesterday announced that he will retire from the company in January.

Maxwell will be succeeded as chairman and chief executive by James A. Johnson, Fannie Mae's vice chairman, who ran Walter Mondale's 1984 presidential campaign.

When he retires on Jan. 31, Maxwell said, "I will have been at Fannie Mae one day short of 10 years, and I've always felt that that's about the right amount of time for a CEO of a very large corporation to serve. ... For a variety of reasons, I think it's time for me to enter a new phase of my life."

Maxwell, 60, is leaving a job that paid him $1.3 million in salary and bonuses last year. And as owner of 100,000 shares of Fannie Mae stock -- which yesterday were worth $27.50 a share -- he apparently faces no immediate financial pressure.

The company Maxwell leaves behind is vastly different from the one he took over when he succeeded Oakley Hunter a decade ago.

Originally part of the government, Fannie Mae assumed its present form as a "government-sponsored enterprise" -- congressionally chartered but privately owned -- in 1968. Its mandate, then as now, was to provide capital for housing.

The company was slow, however, to recognize the changes sweeping through the economy in the late 1970s. Operating much like a giant savings and loan, it borrowed money by issuing bonds to private investors, then used the money to buy mortgages from banks and thrifts. These transactions provided lenders with new money to make more loans, while Fannie Mae made money because, as a quasi-government entity, it could borrow at lower rates than home buyers paid on their mortgages.

The scheme worked when interest rates were relatively stable. But after interest rates skyrocketed in the late 1970s and early 1980s, Fannie Mae found itself in much the same position as many savings and loans -- holding a large portfolio of older, low-rate mortgages while having to borrow funds at higher rates.

Maxwell recognized that the solution lay in shifting interest-rate risk to others through the use of mortgage-backed securities. These securities, which are sold to investors such as pension funds and insurance companies, represent interests in groups of mortgages. Millions of dollars worth of mortgages are pooled together, and holders of mortgage-backed securities are entitled to share in the payments of principal and interest as they come in. Thus, the investors bear the risk if interest rates rise.

Combined with careful portfolio management and tighter controls to cut foreclosures, this strategy propelled Fannie Mae solidly into the black by the mid-1980s.

Corrected for splits, the company's stock price rose from about $2 a share when Maxwell took office to a high of $47 a share, though it since has fallen back as the stock market has declined. Yesterday, on news of Maxwell's retirement, the stock declined $1.50 on the New York Stock Exchange.

"The two major things that Maxwell did, I think, were to put the company into mortgage-backed securities, which have been a gold mine, and, secondly, to tighten underwriting standards" to reduce the number of loan defaults, said David S. Penn, an analyst with Legg Mason Inc. in Baltimore.

The mortgage-backed securities business, coupled with the enormous growth in housing during the decade, propelled Fannie Mae into the forefront of financial institutions. It has become one of the Washington area's biggest employers, with 1,500 people here and another 1,000 in offices around the country.

Penn said that financially, Fannie Mae "is pretty much on cruise control" now and that the bigger challenges facing the new CEO are political.

Because of its government connection, the financial markets on which Fannie Mae bonds are sold have always assumed that the federal government would ultimately back the bonds if Fannie Mae were ever to find itself short of cash and unable to pay its debts. Now, the Bush administration, hoping to avoid any repeat of the savings and loan crisis, wants to make that relationship more explicit, putting Fannie Mae and a number of other such enterprises under greater government supervision and requiring them to build up enough cash reserves to qualify for triple-A credit ratings.

Maxwell had become the leading critic of the Treasury proposal -- though yesterday he said he would accept higher capital standards if requirements were imposed in an orderly way.

Maxwell was noted for his low-key style and immense charm, which benefited him greatly in his dealings with Congress and in other public forums. Inside Fannie Mae, he was regarded as intelligent, hard-working and demanding. He inspired loyalty among those with whom he was compatible but sometimes clashed with others. During his 10 years, Fannie Mae had five presidents, some with tenures as short as a few months.