(Bloomberg) -- PwC agreed to pay $335 million to settle Federal Deposit Insurance Corp. allegations that the firm was negligent in its audits of Colonial BancGroup Inc., an Alabama bank that collapsed after the 2008 financial crisis.

The agreement, announced in a Friday statement by the FDIC, closes a difficult chapter for PwC with the U.S. agency that could have been even worse.

In July, a federal judge ordered the accounting firm to pay $625 million after ruling that it had failed in its audits of the bank from 2003 to 2005, and for 2008. PwC didn’t design the audits to detect fraud or gather enough evidence, according to U.S. District Judge Barbara Jacobs Rothstein.

Colonial BancGroup was the parent company of Colonial Bank, which failed in 2009 amid a fraud perpetrated by its largest customer, Taylor Bean & Whitaker Mortgage Corp. The collapse -- the sixth largest of a bank in U.S. history -- cost the FDIC’s deposit-insurance fund about $3 billion, the agency said.

PwC said in a Friday statement that the FDIC’s claims have been settled “to their mutual satisfaction.”

FDIC board member Martin Gruenberg, the regulator’s chairman during the Obama administration, opposed the settlement.

“Given PwC’s professional negligence, which contributed directly to the failure of Colonial Bank and large losses to the Deposit Insurance Fund, I voted against authorizing the settlement without a written admission of liability by PwC,” he said in a statement.

--With assistance from Chris Dolmetsch.

To contact the reporter on this story: Jesse Hamilton in Washington at jhamilton33@bloomberg.net

To contact the editors responsible for this story: Jesse Westbrook at jwestbrook1@bloomberg.net, Robert Schmidt

©2019 Bloomberg L.P.