BB&T Corp. and SunTrust banks will merge in a $66 billion all-stock deal that will create the nation’s sixth-largest bank in terms of assets and deposits, the two companies announced Thursday.

The merger reflects the growing consolidation in the banking industry. The two banks, which have a significant Mid-Atlantic presence, cited the need to “accelerate investment in transformative technology” to compete with rivals with more resources.

The new company will have $442 billion in assets, $301 billion in loans and $324 billion in deposits serving more than 10 million U.S. households, according to the announcement by the banks.

BB&T Corp., based in Winston-Salem, as of September had 1,958 offices in 15 states and Washington, D.C.

Atlanta-based SunTrust is one of the largest bank holding companies in the Southeast. It was created by the merger of Trust Corp. of Georgia and Sun Banks in 1985.

The new company will be based in Charlotte and operate under a new name — not yet announced — but keep operations in Winston-Salem and Atlanta.

BB&T shares were up nearly 4 percent on the news, closing at $50.46. SunTrust shares were up more than 10 percent, to $64.72.

SunTrust shareholders will receive 1.295 shares of BB&T for each share they own. The per share deal value of $62.85 is at a 7 percent premium to SunTrust’s closing price on Wednesday, according to Reuters.

The merger can deliver the scale that would make spending on new technology worth it in the long run, analysts said. Personal banking has changed dramatically with the rise of online banking.

“Economies of scale have been elevated due to the advent of digital banking,” said Gerard Cassidy, head of U.S. bank equity strategy for RBC Capital Markets. “The advent of the iPhone in ’08-09 transformed the delivery of retail banking product.”

“Our clients now demand what I call real-time satisfaction,” said BB&T chief executive Kelly King in a CNBC interview. “They want what they want, when they want it.”

The merger unites two banks with a long history of doing business in the south. King and SunTrust chief executive William Rogers Jr. are longtime friends. King, 70, will be the chief executive of the new company. Rogers, 61, will be president and succeed King in 2021.

BB&T dates to the late 1800s and North Carolina, where it began as the Branch Banking and Trust Company, named for Alpheus Branch, a North Carolina businessman.

The company has grown through acquisitions, including the 2003 acquisition of First Virginia Banks of Falls Church, Va.

SunTrust has been a key player for more than a century in the Atlanta business community. It is known for its long-standing business relationship with The Coca-Cola Company.

SunTrust was paid in shares of Coca-Cola as compensation for underwriting the beverage giant’s initial public offering in 1919. The bank sold those shares several years ago to help tune up its risk profile as part of stress tests imposed by federal regulators. Forbes reported at the time that the company sold its 60 million shares for a pre-tax gain of $1.9 billion, some of which went to the SunTrust Foundation.

Ken Leon director of equity research at CRFA, a research firm, has SunTrust rated as a “strong buy” in a note Thursday morning on the merger. He sees the possibility for more mergers to follow.

“The merger could be prescient of similarly-size transactions, particularly in the $100 billion to $250 billion asset range,” he said, “as banks seek to scale to compete with larger banks, lowering expenses to grow profitability as organic opportunities face headwinds.”

The deal is the first of its size since the financial crisis of 2008-09. Analyst Brian Klock of Keefe, Bruyette & Woods, said regional banks in the $50 billion to $500 billion asset range have become healthier over the past decade, building confidence from federal regulators and giving them more range to do deals.

“Regulators have said it’s okay for you guys to get bigger,” Klock said. “At first, they didn’t want them to get too big after the financial crisis. There was a fear that getting bigger was increasing their risk and making them too big to fail. That’s why you haven’t seen a big bank deal in a decade.”

But so-called regional banks such as BB&T and SunTrust need to get bigger so they can spread their costs over a bigger customer base and increase profits.

“That is why scale matters,” Klock said. “They have gotten bigger, but still don’t have the scale of JPMorgan, Bank of America and Wells (Fargo).” Klock has an “outperform” rating on SunTrust and “market perform” on BB&T.

Klock said the merger have to be approved the Federal Reserve, Department of Justice, as well as shareholders. He said state bank regulators in Georgia and North Carolina may also have some say.

“It should get approved with conditions,” said Jim Rosener, a corporate finance attorney with Pepper Hamilton. “Today’s not the first day the regulators have heard about the possibility.”

Both banks have overlap in the Mid-Atlantic, including cities such as Washington, D.C. The overlap presents cost savings opportunities. Regulators may insist on some divestments.

“They are going to have to do some stuff to get there, whether it’s branch sales or other part of the business,” Rosener said of the approval process. “I haven’t looked at the Venn diagram, but the overlap on the customer base would have to be pretty similar.”