Massachusetts Attorney General Martha Coakley brokered a $3 billion loan modification deal with Bank of America subsidiary Countrywide Financial Corp.

The settlement, which was filed on Wednesday in Suffolk County Superior Court in Massachusetts, builds on Countrywide’s 2008 agreement with 43 other state attorneys general and the District of Columbia. The prior agreement called for Countrywide to modify loans for certain delinquent borrowers and builders based on the U.S. Department of the Treasury’s Home Affordable Modification Program standards.