Bank of America agrees to pay $8.5 billion to investors to settle claims that mortgage-backed securities sold by its Countrywide Financial unit failed to meet underwriting requirements and other guidelines.

Investors, include Black Rock, Federal Reserve Bank of New York and Pacific Investment Management Co., demanded in October that Bank of America repurchase home loans that had been packaged into bonds by Countrywide Financial Corp., which it acquired in 2008. The settlement covers 530 mortgage trusts with an original loan balance of $424 billion, or about half of the bank’s so-called private-label deals.

The firm won’t need to sell shares to pay for the settlement, and it may take two quarters to regain capital depleted by the deal. The settlement will contribute to a second-quarter loss of $8.6 billion to $9.1 billion, or 88 cents to 93 cents a share.

Bank of America also said it will add $5.5 billion to a liability reserve for future loan-repurchase demands in the quarter and post $6.4 billion in other charges including legal costs and a writedown of mortgage-unit goodwill.

Some experts argue that the settlement could pave the way for similar agreements between private investors and other banks including Wells Fargo and JPMorgan Chase, which in addition to Bank of America, service the vast majority of US mortgage.