The heads of two giant federal organizations who were at each other's throats a few months ago joined hands yesterday to announce the expansion of an effort to stimulate investment in cities.

The program was begun last February by the Federal National Mortgage Association, known as "Fannie Mae," which is the largest single buyer of mortgage loans in the country.

Fannie Mae said it would commit $200 million to buy interests in urban residential and commercial mortgages from private lenders, such as banks and savings and loans, if they would use the Fannie Mae money to re-invest in cities.

Yesterday Fannie Mae announced that, with approval from the Department of Housing and Urban Development, it was adding $500 million to its original commitment and said that, when re-invested, the total new private development money for cities could reach $1.4 billion.

The significance was more in the history behind the announcement than in its size; $700 million is relatively small considering that Fannie Mae's assets are more than $43 billion and the number of houses that could be financed is about 24,000.

It was considered important that the announcement was made jointly by the two combatants-turned-allies -- Patricia Roberts Harris, the HUD secretary who has pushed private industry to do more for poor people, minorities and cities, and Oakley Hunter, the FNMA chairman who has fought her efforts to impose tight regulations on his agency.

A year ago Harris tried to have Hunter ousted as chairman of the association. When that failed, she proposed rules requiring Fannie Mae to purchase up to 30 percent of its mortgages in inner-city areas and at least 30 percent for low and moderate-income family housing.

That failed, too. But last August Hunter accepted some new regulations, which included the 30 percent targets as goals, not mandates. The regulations were touchy because Fannie Mae, set up by Congress 10 years ago, is both a private corporation and a quasi-public entity.

So yesterday's occasion -- presided over by a smiling Vice President Mondale in the old Executive Office Building before about 100 urban and housing specialists in and out of government -- was a public reconciliation. Harris called it "the Hunter and Harris show for the Fannie Mae side or the Harris and Hunter show for the HUD side."

Hunter stressed Fannie Mae's "commitment to our nation's cities" and said the country faced "no more serious problem than the deterioration of our cities."

Harris called Fannie Mae's new effort "a relatively small program," but she said "it is exemplary" and predicted it would "encourage investment in the city."

Mondale called it "a great example of a successful joint effort."

Hunter said it would work like this: A mortgage lender, say, a bank, would assemble a pool of conventional mortgages in older urban areas with other banks, and Fannie Mae would buy an interest, or "participation," in the pool, ranging from 60 to 90 percent. The borrower, or homeowner, would continue paying the bank that issued the loan, and the bank, in turn, would use the Fannie Mae proceeds to finance mortgages of other urban homes or businesses.

The program is not designed to combat the displacement of poor people when their neighborhoods are being upgraded by middle-class investors, Hunter said.