Alabama state regulators officially closed Colonial Friday night. But it had been embattled for months, and its failure was considered imminent. Its balance sheet was saddled with construction and commercial real estate loans, and its financial condition had been rapidly deteriorating. Toward the end, Colonial tried to secure federal bailout money; but those efforts turned up several accounting irregularities that prompted a criminal investigation by the Department of Justice and the Treasury Department.

The deal ensures that the bank’s depositors will not suffer losses, although its stockholders will be wiped out. But the F.D.I.C.’s industry-supported insurance fund will be liable for a big portion of Colonial’s $25 billion loan portfolio.

The F.D.I.C. will absorb all the losses on a $3 billion pool of the most risky assets, including those believed to be entangled in fraud, according to a person briefed on the pool. Federal regulators will split the losses with BB&T on another $15 billion pool that is largely made up of commercial real estate and construction loans. BB&T will be responsible for losses on the remaining $7 billion worth of assets, which it will own outright.

Federal regulators have offered similar loss-sharing arrangements to lure prospective buyers for several other seized banks. With the number of bank failures expected to rise, F.D.I.C officials have grown increasingly concerned about protecting the deposit insurance fund. It had been drained to about $13 billion at the end of the first quarter, the latest number available, and some banking experts are worried that the agency might be forced to turn to an emergency credit line from the Treasury Department for short-term funding.

Image A branch in Washington, of BB&T, a big bank that bought Colonial BancGroup on Friday. Credit... Chip Somodevilla/Getty Images

That, in turn, could put even more pressure on the banking industry if the F.D.I.C. imposed another costly assessment on banks. “Banks need that money to rebuild capital so they can lend more,” said Jaret Seiberg, a financial policy analyst in Washington.