For nearly two decades Bank of Vienna has been a sleepy, proudly independent bank that never outgrew its roots in the small surburban community it serves.

But for more than a year the Vienna bank has been the center of an internecine squabble that has divided the board of directors, cost the chairman his position, prompted three related lawsuits and eaten about one-third of the bank's annual profits in legal fees. The annual stockholders' meeting last April had to be canceled because of problems related to the dispute and it still hasn't been rescheduled.

The split in the board of directors has left Bank of Vienna vulnerable to a takeover by two of Virginia's biggest banking organizations, who are bidding against each other for the $25 million bank.

Most directors of the bank and its management want to remain independent, according to board member Douglas Bywater, "but the handwriting is on the wall."

Bank of Virginia of Richmond has contracts to purchase 21 percent of the bank's stock and is bidding $31 a share for the rest. Bank of Vienna directors have rejected the Bank of Virginia offer and instead have agreed to merge with Dominion Bankshares Corp. of Roanoke, which is offering $35 a share for the Vienna bank's stock.

The bank's trauma began in the spring of 1981 when several officers and directors, including President H. E. McCarty Jr., set up a partnership to buy Bank of Vienna stock. Over the next few months the partnership bought 3,072 shares at prices ranging from $16.75 to $17.50 a share. Today, because of the merger offers, the stock is worth between $31 and $35 a share.

While the partnership was buying stock, neither other board members nor the shareholders who sold stock knew what the partnership was doing.

As is common at many small banks with relatively few stockholders, investors desiring to buy or sell shares often contacted the bank itself. The president's secretary kept a list of such shareholders and distributed that list to the board of directors.

According to a report prepared for the bank by a Washington law firm, the partnership was set up to keep the bank's stock in friendly hands to forestall a takeover. The report said that because of the list, McCarty knew there were 3,000 to 4,000 shares of stock waiting to be sold, making the bank vulnerable to a takeover by one of the big statewide banks.

The partnership, called "HGM," bought stock at first with funds borrowed from the Bank of Vienna by Meyer Abraham, the bank's second-largest shareholder and a board member since last April. Abraham then passed the funds on to the partnership.

The loans to Abraham were approved by bank president McCarty. The loans were bigger than McCarty had been authorized by the board to make on his own accord, the law firm discovered. McCarty also did not inform the board of the loans, which were made at a market interest rate and were secured by deposits Abraham kept in the bank.

Wyatt Durrette, the lawyer for the individuals who made up the now-dissolved partnership, said its members made no special attempt to keep the partnership secret, but also said it was three months before the partners told other board members of HGM's existence. By then the partners had bought 3,072 shares of stock. ichael Juhasz, the bank's biggest shareholder and its chairman when the HGM partners told the board about their purchases, said he felt "betrayed" by HGM and resolved to sell his interest in the bank.

Under pressure from fellow board members, the HGM partners agreed in June 1981 to dissolve the partnership. But that action did not stop a group of shareholders from suing the partnership and the bank in U.S. District Court in Alexandria. The lawsuit claimed the board and HGM members violated their duty to the stockholders by not disclosing the partnership's stock purchases.

The stockholders' lawsuit was later settled out of court, but not before it produced another legal action by Juhasz, who had been ousted as chairman but remained a board member. The bank should have disclosed the existence of the stockholders' lawsuit in its annual meeting notice, Juhasz said. He asked for a court order delaying the annual meeting because the information was missing from the meeting notice.

The Juhasz lawsuit was dismissed after the bank agreed to postpone the meeting and issue a new notice to shareholders.

After being forced to cancel the stockholder session, the directors set up a legal committee to look into HGM and its fallout. Chaired by board secretary L. Dean Wallace, the committee included Bywater, director George Leimbach and Malcolm Huffman, who had replaced Juhasz as chairman.

The committee submitted a highly critical report, concluding, among other things that:

* The HGM partners violated their "fiduciary trust to the directors and stockholders" because their purchases of stock amounted to a takeover attempt.

* Bank president McCarty had "a material advantage in the marketplace" because he knew which shareholders wanted to sell.

* Meyer Abraham should not be reelected to the board because of "his preferential loan relationship with McCarty."

* McCarty should be more carefully supervised.

On May 11, the directors rejected the committee report by a 6-4 vote. Four of the six votes to reject the report were cast by former HGM partners -- McCarty, Abraham, Jack Hayes and John Buhl. Bywater and Huffman also voted against accepting the report of the committee they had served on.

Directors then hired the Washington law firm Verner, Liipfert, Bernhard and McPherson to investigate events. The law firm, which reportedly was paid more than $30,000, reported on July 21 that it had found a number of largely technical irregularities. The report suggested the board consider what action it might take about McCarty exceeding his bank-prescribed lending authority. Like the internal committee, the lawyers' report recommended the HGM partners voluntarily sell back the stock they bought to any selling shareholder who wanted it back. The bank board also urged the partners to offer to sell the stock back.

The HGM partners allowed a husband and wife who were among several shareholders who sued HGM and the bank to buy back their stock at the same price they sold it for. The bank also paid nearly $14,500 for the plaintiffs' legal fees and spent about $40,000 to defend itself, sources familiar with the case said.

HGM partners told the bank's board they also would offer to sell back the stock to the other original owners at the 1981 price, but the partners later changed their mind and refused to do so. Lawyer Durrette said offering to sell back the stock would seem to be an admission of guilt.

Durrette said he recommended the six members of the partnership decline to talk to a reporter because, he said, several Bank of Vienna stockholders have threatened to sue to recover their stock.

As a result of the HGM controversy, the bank's 10-member board has split into warring factions.

The board of directors of the bank is composed of local Virginia businessmen. Abraham is an innkeeper and McCarty is president of the bank. Buhl is president of Buhl Electric Co.; Hayes is president of J. S. Hayes Building Supplies Inc.; Bywater is a Vienna attorney; Huffman is a vice president of Hearthstone Properties Inc.

The three board members who in recent months have voted most consistently with Juhasz were Leimbach, president of Colonial Carpets; Wallace, a former Vienna City Council member, and Dr. Raul R. Garcia, a physician.

Juhasz, the bank's largest shareholder, was ousted from the largely ceremonial post of chairman in mid-term last November. He remains on the board, but the majority removed him from the slate of nominees for reelection.

After his ouster as chairman, Juhasz began gathering options to buy bank stock from other shareholders for $31 a share. Concerned that Juhasz might collect enough shares to gain control of the bank, the board sued him last December, trying to get a court order to stop his option purchases.

The lawsuit was dismissed within a month, and Juhasz later joined forces with Bank of Virginia. That bank agreed last June to pay $31 a share for Juhasz's shares and those of nine other investors, amounting to 21 percent of the bank's stock.

Because that large a chunk of bank stock is under Bank of Virginia's control, it is inevitable that the bank will no longer remain independent, said director Bywater. lthough the majority of directors prefer the $35 offer from Dominion to the $31 bid by Bank of Virginia, Bywater said that if the Bank of Virginia raises its offer, directors would have to reconsider. Sources close to the Bank of Virginia predict the big Richmond bank will increase its bid.

Bank of Vienna might have been able to maintain its independence had not Juhasz and the others contracted to sell their stock to Bank of Virginia. Bank of Virginia first made an overture to Vienna in the late summer of 1981, but did not pursue it after directors proved unreceptive.

Bank of Virginia tried again to arrange a friendly merger after gaining control of the Juhasz stock, a source close to the bank said. After getting a "cold shoulder" from Vienna directors, Bank of Virginia decided to pursue a hostile takeover regardless of the board's decision. The Washington securities firm Johnston, Lemon & Co. is directing the takeover attempt.

To fend off the Bank of Virginia bid, Vienna directors then arranged the friendly merger with Dominion. The HGM partners hoped to avoid just such a merger when they met March 17, 1981, at the Vienna Inn, owned by Meyer Abraham.

According to the Verner, Liipfert report, McCarty approached Abraham and directors Buhl and Hayes because they had money and he did not.

McCarty also brought in the bank's executive vice president, George Hicks, and Abraham's son Mark, an attorney. The elder Abraham, Buhl and Hayes provided the money, the report said. McCarty, Mark Abraham and Hicks provided the legal and banking expertise. The partnership took its name from the first initials of H. E. McCarty, George Hicks and Mark Abraham. The partners authorized bank president McCarty to vote the stock.

According to the Verner, Liipfert report, McCarty was designated to tell other board members about HGM, but did not until the June 26, 1981, board meeting, after prodding by Buhl and Hayes.

Hicks, Abraham and Buhl contributed the Bank of Vienna stock they already owned to HGM to be used as collateral for loans. But before the partnership could arrange its own financing, some stock became available for purchase.

The lawyers said Abraham borrowed $20,000 from Bank of Vienna on March 17 and another $15,000 on March 24 that was used to purchase stock on behalf of the HGM partnership.

Because the loans exceeded McCarty's lending authority under the bank's internal policies, he was supposed to report them to the loan committee, the Verner, Liipfert report said.

He did not. "McCarty stated that he intended to bring the loans to Abraham to the attention of the loan committee, but claims he forgot. . . . McCarty had not disclosed the existence of HGM to the board at the time the loans were made, and, in his words, bringing the loans to the committee at that point would have looked 'shabby,' " the internal investigation report said.

Later the partnership obtained its own financing -- a $36,000 loan from Women's National Bank of Washington -- and used some of the funds to repay part of Abraham's loans.

Forming the partnership to buy stock "was something probably they shouldn't have done," said board member Bywater. Nevertheless, he said, the partners did nothing "materially wrong." He said he urged dissolution because a partnership of directors and officers could create an impression of wrongdoing that was not there.

When the partners agreed to dissolve HGM, "everybody felt we had resolved the issue," Bywater said. "There was no indication the stock was worth any more than they had paid for it. . . . It wasn't until December [when Juhasz began seeking options] that anybody realized the bank might be worth more than the $18 to $20 a share people had been paying. . . . At the time [in the spring of 1981] in my opinion, they got the market price. HGM was the only real purchaser."

"I understand how someone can conclude that there were improper motives and there are those who profess to honestly believe there were," said Durrette, the lawyer for the HGM partners.

All the partners wanted to do, Durrette said, was take steps to insure that the Bank of Vienna remained an independent bank.

He agreed that HGM partners should have told other directors, but insisted there was no concerted attempt to keep the partnership secret, since the partnership agreement was filed for public inspection in Fairfax County.

Durrette said in an interview that there were no other buyers of Bank of Vienna stock in the spring of 1981 and the price HGM paid was fair. "They thought they were doing a good deed for the bank and its shareholders."