Former Washington Star publisher Joe L. Allbritton yesterday announced agreement to pay approximately $27 million for the largest block of shares in Riggs National Bank, the Metropolitan area's biggest financial institution.

After a full day of negotiations that ended about midnight Wednesday, Allbritton signed a deal to buy 398,000 shares of Riggs stock from Northern Virginia businessman Jorge E. Carnicero for $67.50 a share. The purchase price is 20 percent above the stock's book value of $56.25 a share and about $20 a share above the market value of the stock when the agreement was signed.

Carnicero, board chairman of Dynalectron Corp., had turned down an offer of about $80 a share made by unidentified West European interests earlier this year. Foreign acquisition of a major holding in Riggs a bank with historic ties to the federal government, would have added substantially to a storm of protest that has been raised about purchases of U.S. banks by foreign interests.

In an interview yesterday, Carnicero said he would like to have sold to Allbritton at the "slightly higher" price but "I'm happy I have sold to someone who is involved in this community . . . . The difference in price was a difference of quality, it was important to leave Riggs bank ownership here." a

Allbritton would not talk to reporters yesterday, but his current thinking reportedly is that he will not seek any day-to-day management role at an institution he thinks is well-run by executives who know their work. He is said to have ruled out the bank chairmanship for himself and is not even planning to propose himself for the board of directors at this time.

The stock purchase from Carnicero must be approved by federal banking regulators before the final transaction may take place, a procedure that could take about a month.

One of the nation's wealthiest individuals, Allbritton had extensive management experience as well as substantial investments in Texas banks before buying The Washington Star in 1974. He since has maintained homes in Houston and Washington and served on the board of directors at Riggs rival American Security Corp. until after he sold the newspaper to Time Inc. in 1978.

The Allbritton transaction comes at a time when federal regulators and bank industry leaders are talking seriously about some form of regional banking in the 1980s -- a prospect that could permit Riggs and other D.C.-based banks to expand full operations into either Maryland or Virginia, or possibly both states, for the first time.

Riggs officers recently proposed establishing a bank holding company that could acquire or establish related financial businesses in any state. With assets of $3 billion, Riggs already owns Central Charge Service, the area's largest credit-card business, and recently opened offices in London and Hong Kong and announced plans for an international banking subsidiary to be based in Miami.

At the same time, international financial trends have brought Middle Eastern investors to Washington to acquire control of the area's third-largest finacial institution, Financial General Bankshares Inc., which owns the First American Banks of Washington, Maryland and Virginia. Foreign banks and investors have expressed interest in buying other area banks over the past several years.

Trading in Riggs stock was halted early yesterday, to allow to dissemination of news about Allbritton's agreement. When trading resumed, brokers said investors were holding onto what they had and few sellers were found. The stock advanced $2.50 on the day to $49.

Over the past 52 weeks, Riggs stock traded as low as $34 a share and then rose as high as $53, after The Washington Post reported the Allbritton-Carnicero talks on Nov. 20. There has been no information from Allbritton about whether he will seek to buy additional shares. Carnicero had authority from government regulators to buy up to 25 percent of Riggs common stock.

Allbritton initiated the talks with Carnicero last month through the Washington investment firm of Folger Nolan Fleming Douglas, which also represented the Texas millionaire when he started negotiations to buy The Star from descendants of that newspaper's founders.

When added to the Riggs shares Allbritton has been buying on his own, the Carnicereo stock will give Albritton 15.4 percent of 2.99 million common shares outstanding in Riggs bank, an institution founded in 1836.

Under cumulative voting powers required for shareholders of national banks, Allbritton automatically would be able to elect a minimum of three persons to the Riggs 25-member board of directors, if he chooses. Carnicero, who is a Riggs board member, picked his daughter and a Dynalectron business associate as directors of the bank.

Officers of the bank also were silent on the propective substitution of one millionaire for another as the largest owner. Both Allbritton and Carnicero prefer to work quietly, behind the scenes, and they do not seek media attention. But Allbritton has been active and aggressive in his previous banking investments while Carnicero's only interest in Riggs was as an investment.

Riggs Chairman Vincent C. Burke Jr. said in a brief telephone conversation that he had known Allbritton "personally since he arrived in Washington six years ago." Burke described Allbritton as "a very successful businessman and one who is extremely interested in our city . . . . I look forward" to working with him at the bank.

But Burke, a native of Washington and generally outspoken, declined to discuss any other matters, such as makeup of the board in the future or Allbritton's possible role in Riggs management.

Burke also would not comment on one report that he helped initiate the Allbritton negotiations in order to keep the large Carnicero holding in local hands. Carnicero did state that "the bank feels better this way" -- with Allbritton, instead of foreign banking interests, owning 15 percent. Allbritton also was interested in keeping local stock ownership.

Carnicero had acquired his Riggs stock gradually during the 1970s. He purchased shares at an estimated average price per share of under $40, which means that he earned more than $10 million on his Riggs investment in just a few years, assuming the Allbritton sale is approved.

Carnicero said he dicided to sell his Riggs interest to increase his own investment in Dynalectron, a rapidly expanding firm that specializes in technical services, engineering and energy.