Bank of America (BAC) will pay $1 billion to settle harm done to the Federal Housing Administration by mortgage originator Countrywide, which it acquired in 2008.

The settlement also resolves claims that BofA defrauded the government by failing to determine the eligibility of borrowers participating in the Home Affordable Modification Program.

The deal involves a $500 million payment directly to the FHA. The other $500 million will fund a special loan modification program for underwater Countrywide borrowers. Some of the workouts will include principal reductions.

BofA will begin soliciting qualified borrowers soon.

The $1 billion FHA payment was attached to the other $25 billion foreclosure settlement with 49 state attorneys general, the Justice Department and the top-five mortgage servicers. Oklahoma was the only state that declined to participate in the settlement.

The BofA stake in the $25 billion settlement is roughly $11 billion.

The bank said "the vast majority" loans under the FHA settlement were originated by Countrywide "prior to or soon after" its acquisition by BofA in January 2008.

"The decision to settle these claims is in keeping with the bank's strategy to resolve remaining Countrywide issues as quickly as possible," a bank spokesman said.

Department of Housing and Urban Development Secretary Shaun Donovan said the FHA deal with BofA is the largest False Claims Act settlement related to mortgage fraud.

"Through their underwriting and origination of tens of thousands of government-insured loans to unqualified borrowers, Countrywide Financial subsidiaries systematically abused the Federal Housing Administration and became some of the main players in this country's financial crisis," said U.S. Attorney Loretta Lynch. "It also puts lenders on notice that they will face serious financial consequences for violating their obligations under the FHA's programs."