National Bank of Washington, the District's third largest bank, reported yesterday that it lost $399,600 in the second three months of the year because it sold more than $20 million of low-yielding municipal bonds at an after-tax loss of nearly $1 million.

Chairman Luther H. Hodges Jr. said that the bank can put the proceeds of the municipal bond sales in investments yielding so much more income that the loss can be made up within a year.

Meanwhile, American Security Corp., which owns the District's second biggest bank, reported second-quarter earnings of $6.4 million (88 cents a share), down from $6.8 million (94 cents) in the second quarter of 1981. American Security said that it lost $420,000 on securities sales during the second quarter. Income before securities transactions was $6.8 million, the same as in 1981.

American Security's assets were $3.1 billion on June 30, and its deposits totalled $2.3 billion. On June 30, 1981, assets were $2.8 billion and deposits were $2.2 billion.

Jarvis W. Moody, chairman of American Security, said the second-quarter earnings performance was "in line with expectations, given the economic conditions and their impact on the banking industry."

At most banks, problem loans are growing as the combination of high interest rates and severe recession makes it increasingly difficult for bank customers to pay their loans.

National Bank of Washington had income of $636,400 (46 cents a share) before securities transactions compared with $794,927 (57 cents) in the second quarter of 1981. After securities transactions during the three months ended June 30, the bank lost 29 cents a share.

Hodges, who was named chairman of NBW 20 months ago after a scandal involving insider loans by the previous management, has been trying to rid the bank of a mammoth portfolio of low-yielding mortgages and municipal bonds.

He said in an interview that the bank would have liked to have sold more than $20 million in municipal bonds, but the bank would have had to sell the bonds remaining on its books at such a big discount that it would have taken much more than a year to earn back the loss. He said the bank undertook the municipal bond sales with full consultation with the Comptroller of the Currency, which regulates nationally chartered banks.

During the past year, the bank's assets grew $221 million to about $1.1 billion, and deposits increased $164 million to $812 million.

In another development, Suburban Bancorp, parent of the Rockville bank, reported second-quarter net income of $4.97 million ($1.04 a share) compared with $4.23 million (90 cents) during the second quarter of 1981.

Suburban's income before losses on securities transactions was $5.2 million ($1.09) during the second quarter compared with $4.44 million (93 cents) in the second three months of 1981.

The bank's assets were $1.7 billion at the end of June, 11.2 percent higher than on June 30, 1981, and deposits grew 3.1 percent to $1.3 billion.