A full-fledged takeover war surfaced in Washington's banking community last night, as NS&T Bank announced plans for a possible bid to acquire Security National Bank -- already the target of separate takeover or merger bids from two smaller D.C. financial institutions.

NS&T, the new trading name of National Savings & Trust Co., is the city's fifth-largest bank with assets on June 30 of $508 million. A meeting of NS&T directors has been set for next Tuesday to consider pursuit of Security National, and terms of a public tender offer for Security shares, if any, will be determined at that meeting, NS&T Chairman Joseph Riley said last night.

Riley's announcement came one week after the holding company of Madison National Bank announced a public offer for Security shares -- a formal bid that was rejected by Security's board within hours in favor of a rival offer to merge with Washington Bank N.A.

NS&T is expected to offer more than the $60-a-share bid from Madison, banking sources said last night. The interest of NS&T is acquiring Security came as no surprise because the purchase of a block of Security shares earlier this year was linked by stock brokerage sources to NS&T interests. The possibility that the larger bank would make a bid for Security apparently touched off negotiations that led to an agreement for Security and Washington Bank to combine.

James Madison Ltd., holding company for Madison National, has conducted on-again, off-again talks with Security National for several years, but no acceptable merger agreement ever has been achieved.

With assets of $137 million, Security is considered a prime acquisition target because of its financial strength and eight D.C. offices at a time when large banks are looking to possible interstate banking. Banks based outside the city are expected to try purchasing Washington banks when interstate branches are permitted, to give them an immediate position in the market.

In the first half of 1981, Security profits also have been strong. Net income was a record $1.3 milloin ($3.20 a share) compared with $956,446 ($2.39) a year earlier, an increase of 34 percent.

In effect, Security directors sought out what is called a "white knight" in takeover war parlance, to prevent what was seen as an unfriendly acquisition by either Madison or NS&T. In the merger agreement they reached, Washington Bank owner Leo M. Bernstein would become chairman of the board and the largest stockholder of Security Nationa.

Madison offered $50 a share for up to 44 percent of Security's 400,000 shares and an exchange of one share of James Madison for each remaining Security share. Security turned this down for a merger in which Washington Bank stock would be converted into Security stock, and the surviving bank would have an increased book value as well as tax benefits from the losses at Washington Bank before Bernstein purchased it last year (it formerly was a troubled bank, Diplomat National).