Bank of Virginia Co. of Richmond and Union Trust Bancorp of Baltimore yesterday signed a definitive agreement to merge the two companies in a transaction accomplished by an exchange of stock. Based on current prices, the transaction could be worth as much as $325 million.

The proposed merger of the banking firms, the third-largest banks in their respective states, brings to three the number of interstate bank combinations to be announced by institutions in the mid-Atlantic region in four months.

News of yesterday's merger announcement prompted industry analysts to renew predictions of accelerated merger activity in the region now that the Supreme Court has upheld the legality of regional interstate banking agreements.

In a related development yesterday, First Maryland Bancorp, Maryland's second-largest bank holding company, announced that it is considering a merger with other bank holding companies in the mid-Atlantic region. First Maryland said it is pursuing discussions that could lead to a merger with a larger bank holding company. Officials declined to be specific, however.

The agreement between Union Trust Bancorp and Bank of Virginia Co. was completed less than a week after Union Trust disclosed that it was holding merger discussions with an unidentified company. The agreement, which calls for Union Trust to be merged into Bank of Virginia Co., is contingent upon regulatory and shareholder approval and is expected to be completed by the end of the year.

The agreement provides for a tax-free transaction in which 4.1 shares of Bank of Virginia common stock will be exchanged for each share of Union Trust stock. Certain "significant shareholders" of Union Trust have agreed with Bank of Virginia to vote for the proposed merger, officials of the two companies said in a joint statement.

In addition, Union Trust has given Bank of Virginia an option to buy 650,000 shares of common stock for $100 each in cash.

Union Trust Co. of Maryland and Bank of Virginia, the two principal subsidiaries of the holding companies, would continue as separate banks within their respective states after the merger, officials said.

The surviving holding company for the two banks will retain the Bank of Virginia Co. name, at least initially, a spokesman said.

A merger with Union Trust is "probably a good defensive move from [Bank of Virginia's] standpoint," said Robert G. Wood, general partner and director of research at Baker, Watts & Co. Wood said the merger would enable Bank of Virginia Co. to increase its size by 50 percent, a critical factor as it contemplates expansion into the region eventually by larger banks.

"Union Trust is a very clean, profitable bank. It has a clean loan portfolio without any foreign loan exposure . . . . Bank of Virginia is getting a good bank," Wood added.

On a combined basis, the new holding company to be formed by a merger would have assets of approximately $7 billion and deposits of $4.9 billion. Bank of Virginia reported assets of $4.6 billion on June 30, and Union Trust Bancorp's assets on the same date were $2.4 billion.

Union Trust yesterday reported earnings of $6.3 million ($2.54 a share) for the second quarter which ended June 30, up 26.5 percent from net income of $5 million ($2.05) in last year's second quarter. Bank of Virginia last week reported six month earnings of $21.8 million.

In Richmond yesterday, Bank of Virginia Chairman Frederick Deane Jr. said the proposed merger gives shareholders of both institutions a "better opportunity to participate in the future deregulated financial service industry."

Individual customers as well as communities in the two states will benefit from the merger in a deregulated banking environment, added J. Stevenson Peck, chairman and chief executive officer of Union Trust.

Speculation had centered on at least two of the larger Virginia banking institutions last week after Union Trust announced its involvement in merger discussions. Two Virginia bank holding companies, Sovran Financial Corp. and United Virginia Bankshares Inc. have already announced plans to merge with bank companies in the District. In addition, both Sovran and UVB have expressed strong interest in expanding into Maryland as part of a three-pronged market strategy.

First Maryland Bancorp, in exploring "opportunities" stemming from recently enacted regional reciprocal banking legislation, said it anticipates a "speedy" conclusion of negotiations.

A merger of First Maryland would have to be approved by Ireland's Allied Irish Banks, which owns 45 percent of its stock. Allied Irish apparently wants to "protect its investment" from growing competition in the region, Wood noted.

"A buyer would probably offer a pretty good premium and Allied Irish would probably end up with about 20 percent of the company," he said.

First Maryland yesterday reported net income of $7.3 million ($1.15 a share) in the second quarter, up 13.2 percent from earnings of $6.5 million ($1.07) in last year's second period.