The Federal National Mortgage Association, the mortgage finance giant, announced plans yesterday to sell a record $10 billion worth of its loans in an effort to protect itself against future swings in interest rates.

Fannie Mae officials said that, although the sales will not materially improve short-term earnings, they will allow the company to dispose of a large portion of the low-rate, long-term mortgages that nearly ruined Fannie Mae when interest rates soared in the early 1980s.

Fannie Mae is a congressionally chartered, publicly owned corporation that buys mortgage loans from savings and loan associations and other lenders, thus providing these lenders with funds to make more loans.

From time to time, Fannie Mae resells some of the loans it purchases to institutional investors, but the sales proposed yesterday would be more than twice as big as the largest previous. It would also be the largest sale of assets in U.S. corporate history, outside of a merger, acquisition or liquidation of a company, Fannie Mae said.

David O. Maxwell, Fannie Mae's chairman, portrayed the proposed sale as "taking a sledgehammer" to "the block of granite," the term he used to describe the low-yielding part of Fannie Mae's $95 million worth of mortgages. He said this block totaled $40 billion worth of mortgages at the end of 1985, down from $57 million in 1981.

Virtually all the assets to be sold are loans backed by the Federal Housing Administration and Veterans Administration and purchased by Fannie Mae before 1981, Maxwell said.

Like others in the mortgage finance industry, Fannie Mae was burned by the soaring interest rates of the early 1980s, which depressed the value of the huge numbers of long-term, fixed-rate mortgages already on its books. The firm suffered because short-term borrowing costs far outpaced the yield on these mortgages, many of which offered yields between 7 and 10 percent.

Although the company recently returned to profitability after a major restructuring effort, the plummeting interest rates of the past six months have offered a golden opportunity to dispose of a large chunk of the fixed-rate loans, Wall Street analysts said.

For the first time in several years, Fannie Mae can sell many of these loans without taking a big loss, because the return they offer investors is comparable to the going interest rates, which are between 9and 10 percent, they said.

Maxwell said Fannie Mae expects to conduct the sale at "a wash -- that is, without significant gain or loss" -- by mixing in loans that are above and below market. He said the company will sell the loans gradually during the year through public sales, private placements and auctions.

Fannie Mae also said the mortgages likely will be packaged and sold as mortgage-backed securities, on which the company guarantees the payments of principal and interest. Although the size of the proposed transaction is unprecedented, mortgage industry officials predicted the financial markets would absorb the sales smoothly because all the mortgages would not be sold at once, but gradually over time.

"It is easily the single biggest mortgage financing transaction ever undertaken," said Warren Lasko, executive vice president of the Mortgage Bankers Association of America. But he added, "While it is large in terms of the dollar amount, the impact will be negligible because they're not creating new mortgages, but only recycling old ones."

C. Addison Hanan, an official at Salomon Bros. in New York, one of several brokerage houses that stand to earn millions in fees from handling the Fannie Mae transactions, said huge numbers of mortgage-backed securities have been issued this year. The Fannie Mae issue would constitute a relatively small percentage of the more than $120 billion in additional securities that can be expected to come to market before the end of 1986, he said.

But he and others on Wall Street predicted investors -- particularly pension funds, mutual funds and savings and loans -- would be attracted to the Fannie Mae loans because they offer favorable rates of return compared to other fixed-rate securities, such as Treasury bonds. In the past several months, mortgage-backed securities have been yielding at least a percentage point more in return than comparably priced Treasury bonds, they said.