NEW YORK (AP) _ First Union Corp. will buy First Fidelity Bancorp. for $5.4 billion in a record deal that will create a banking behomoth with offices stretching from Connecticut to the Florida Keys.

The all-stock transaction, announced Monday, represents the largest marriage of two American banks and creates the largest contiguous network of bank branches in the country, bank executives said.

The combination underscores the rapid pace of bank mergers, which creates ever-larger financial institutions and means customers are constantly seeing their banks change ownership.

The pace of these mergers has accelerated as laws that historically have restricted bank activities have been relaxed or disbanded, making it cheaper for banks to operate across state lines.

Bank executives said the combined bank will seek to get even bigger in the Northeast by acquiring community banks and would even consider expanding into Boston, home to several large New England banking companies.

``We have opportunities for further in-market transactions,'' said Anthony Terracciano, chairman and chief executive of First Fidelity. Terracciano becomes president of First Union and will run the bank's northeastern operations and its capital markets division.

The new bank, to be called First Union, would hold combined assets of $123.7 billion. That would make it the sixth largest banking company, displacing New York's Chase Manhattan Corp. which holds assets of $120.72 billion.

The combination will create a bank with 10.5 million customers through 2,000 offices in 12 states along the East Coast from Florida to Connecticut.

Under the terms, First Union has agreed to exchange 1.35 shares of its common stock for each share of First Fidelity common stock.

Based on First Union's closing stock price of $47.625 on Friday, the transaction would be worth $64.29 for each share of First Fidelity common stock, or about $5.4 billion. The deal is expected to close by the end of this year, subject to the approval of regulators and shareholders.

First Union's shares fell $1.75 to close at $45.78 1/2 on the New York Stock Exchange. First Fidelity's shares shot up $10.25 to $59.

The deal is the latest in a string in large bank mergers. In February, Fleet Financial Group announced a $3.6 billion merger with Shawmut National Corp.

Both First Union, the nation's ninth largest banking company, and First Fidelity, which ranks 25th, have been active acquirers, capturing dominant positions in their regions.

By expanding north into the Middle Atlantic, First Union, based in Charlotte, N.C., is tapping into one of the wealthiest consumer markets in the country and gaining access to thousands of small and medium-sized businesses that bank with First Fidelity.

Thirty-five percent of the nation's wealthiest people live in the Middle Atlantic and Southeast and 35 percent of all medium-sized businesses are headquartered there, bankers said.

First Union, which primarily caters to consumers but has also built a respectable corporate business, plans to offer First Fidelity customers everything from loans to mutual funds to exotic derivative securities, said Edward Crutchfield, chairman and chief executive.

``We will gain substantial new fee income'' from marketing First Union products, Crutchfield told a news conference in New York.

First Fidelity decided to sell out to a larger institution to better compete in the rapidly consolidating Northeastern banking market, said Terracciano, who ran corporate banking at Chase Manhattan Bank and was president of Mellon Bank before joining an ailing First Fidelity in 1990 and turning it around.

``We decided we needed a partner,'' Terracciano told reporters and analysts. First Union signs will all be replaced with First Union signs by June 1996.

Some First Fidelity's customers expressed concern that the merger will result in service disruptions. Many have already been through a merger because First Fidelity has acquired more than 20 banks since 1990.

``We hope it doesn't impact us,'' said Pat Kane, comptroller at Danbury Hospital in Connecticut, whose bank was acquired by First Fidelity a few years ago. ``There were massive systems changes that were a headache for us.''

Terracciano acknowledged that customer service suffered during systems conversions, but said that bank mergers don't worry most consumers.

``I think the U.S. public understands that the banking industry is going to consolidate,'' said Terracciano.

One plus for customers is that with little overlap between the two banks' branch networks, few merger-related office closings are expected. Terracciano said consolidating corporate staffs and computer operations could result in up to 120 job cuts.

Analysts said the deal makes sense because the two banks operate in neighboring regions and cater to similiar types of customers. But with little overlap in branch networks, cutting costs _ which is often the main reason banks merge _ won't be easy.

``They have their work cut out for them,'' said David Berry, head of research at Keefe Bruyette & Woods Inc., a New York investment firm.

First Union earned $925 million, or $4.98 a share, in 1994. The bank said it expects to earn $6.31 a share this year, lower than its earlier estimate of $6.55 a share because of dilutive effects of issuing new stock.