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, 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.

The FDIC and BB&T are expected to announce the agreement later Friday.

Colonial has 355 branches in five states and has about $25 billion in assets. Its failure, which had seemed increasingly likely in recent weeks, 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 8.5% at $27.99 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, one of the main trouble spots for Colonial. BB&T's acquisition will expand its presence and might provide opportunities to cut costs. BB&T has only a small presence in Alabama, Colonial's home market.

BB&T has held up better than many regional banks in the financial crisis. It was among the 19 banks on which the Federal Reserve performed a stress test, and, unlike some of its competitors, did not 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. It's unclear which of Colonial's assets BB&T is taking on.

Colonial recently said it might not be able to continue as a going concern. Its problems have been mounting in recent days. Last week, it said it faces a criminal investigation by the Department of Justice, and is operating under various cease-and-desist orders from its regulators.

Thursday, the U.S. District Court of the Southern District of Florida, in Miami, granted a motion by Bank of America Corp. (BAC) for a temporary restraining order to freeze $1 billion of Colonial assets. Bank of America sued Colonial Wednesday to protect its claim on Colonial loans, because it feared Colonial's future was in doubt. U.S. District Judge Adalberto Jordan concluded Thursday that the restraining order was needed because Colonial "is on the brink of collapse."

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

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

-By Dan Fitzpatrick, The Wall Street Journal; dan.fitzpatrick@wsj.com and Matthias Rieker, Dow Jones Newswires; (212) 416-2471; matthias.rieker@dowjones.com