BB&T Corp. (BBT) has reached an agreement with the Federal Deposit Insurance Corp. to purchase deposits and branches of Colonial BancGroup Inc. (CNB), according to a person familiar with the situation.

The deal, approved by the FDIC Thursday night and expected to be formally announced later Friday, will take effect after the bank is put into receivership, this person said. BB&T, based in Winston-Salem, N.C., has already dispatched employees to Colonial markets to prepare for the takeover.

Colonial, based in Montgomery, Alabama, has 355 branches in five states and had about $25 billion in assets and $20 billion in deposits at the end of the second quarter. Its failure, which had seemed increasingly likely in recent weeks as it struggled with real-estate and construction loan losses and faced a federal criminal probe, would mark the fifth-largest bank failure in U.S. history.

BB&T shares jumped on news of the Colonial deal, as it will enable the bank to enter important markets. The stock was up 7.3% at $27.67 in recent trading.

Notably, BB&T will gain access to Texas, one of the nation's more-attractive banking markets. Texas, fueled by the energy industry, has a stronger economy than most states and has been largely sheltered from the current financial crisis.

BB&T already has branches in Florida and Georgia, which have been trouble spots for Colonial owing to souring real estate loans. Still, a bigger presence in Florida remains attractive for BB&T. The bank, which has the bulk of its branches in Virginia and North Carolina, has only a small presence in Alabama, Colonial's home market.

FBR Capital Markets said in a research note that Colonial would fit well into BB&T's deposit base, though warned that BB&T may have to raise capital depending on the details of the transaction, unless the FDIC shares in the losses.

It remains unclear which of Colonial's assets BB&T is taking on.

"If BB&T acquires (Colonial's) deposits and branches, the capital hit is no longer a concern," FBR said. "In this case, we would view the transaction as a big positive" for BB&T.

An FDIC spokesman said the agency doesn't comment on open banks and hasn't issued any press releases Friday regarding bank acquisitions.

A BB&T spokeswoman said she couldn't comment on rumor or speculation. A Colonial spokeswoman couldn't be reached for comment.

BB&T has held up better than many regional banks in the financial crisis. It was among those 19 banks the Federal Reserve performed a stress test on, and, unlike some of its competitors, didn't have to raise additional equity capital.

It did receive money from the Treasury Department's Trouble Asset Relief Program last year, but was among the first to pay it back in June. However, it too faces increasing losses from soured real estate loans.

Colonial, which failed to fulfill the requirements to receive TARP funding, has been struggling with a heavy load of loans tied to residential real estate markets in markets such as Florida and Georgia, which were once hot but now troubled.

Colonial is one of the nation's largest warehouse lenders, which are banks providing smaller banks and mortgage lenders with funding to make home loans later sold to Fannie Mae, Freddie Mac or other investors.

The bank's problems mounted in recent weeks, as it acknowledged it might not be able to continue as a going concern. A deal for Colonial to receive a capital infusion from a group led by Taylor, Bean & Whitaker Mortgage Corp. fell apart and Colonial acknowledged that it was the target of a Justice Department probe at its warehouse lending division and into related accounting irregularities.

Colonial shares have been halted from trading since just after the opening bell Friday. The stock was down 6 cents at 41 cents before the halt.

-By Dan Fitzpatrick, The Wall Street Journal; dan.fitzpatrick@wsj.com

-By Matthias Rieker, Dow Jones Newswires; (212) 416-2471; matthias.rieker@dowjones.com