By Nate Raymond

(Reuters) - PricewaterhouseCoopers has settled a lawsuit accusing the auditing firm of failing to detect the fraud that brought down Taylor, Bean & Whitaker Mortgage Corp in 2009, a lawyer for the mortgage lender's bankruptcy trustee said on Friday.

The settlement ends a civil trial in Miami-Dade County Circuit Court in Florida in which the trustee had sought more than $5.5 billion in damages from PwC. Terms are confidential, a lawyer for the trustee said.

"It was settled to the mutual satisfaction of the parties," said Steven Thomas, the trustee's lawyer.

PwC in a statement confirmed the settlement, using language similar to Thomas. It declined further comment.

The case stemmed from PwC's auditing work for Montgomery, Ala.-based Colonial BancGroup Inc, where Taylor Bean, among the nation's largest privately held mortgage lenders, was a major customer.

The lawsuit accused PwC of missing a massive fraud in which Taylor Bean Chairman Lee Farkas and others hid losses by shuffling money among Colonial accounts and by selling nonexistent or worthless mortgages.

Taylor Bean filed for bankruptcy in August 2009. Colonial filed for bankruptcy that same month, days after regulators seized its banking operations. It was the sixth-largest bank failure in U.S. history.

BB&T Corp <BBT.N> bought Colonial's assets. Farkas was convicted of federal fraud charges and sentenced in 2011 to 30 years in prison.

Taylor Bean's auditor, Deloitte & Touche, and the bankruptcy trustee reached a confidential settlement in 2013.

The case is Taylor, Bean & Whitaker Plan Trust v. PricewaterhouseCoopers LLP, 11th Judicial Circuit for Miami-Dade County, Florida, No. 13-033964.

(Reporting by Nate Raymond in New York; Editing by Chizu Nomiyama, Dan Grebler and Bernard Orr)