Goldman Sachs Group Inc and Morgan Stanley will pay a total of $557 million in cash and other assistance to troubled borrowers to end a case-by-case review of past foreclosures required by U.S. regulators.

The U.S. Federal Reserve said on Wednesday that the two banks will pay $232 million to eligible borrowers and $325 million in loan modifications and forgiveness.

The agreement is similar to the $8.5 billion deal reached between the Fed, the Office of the Comptroller of the Currency, and 10 other bank servicers on January 7.

The Fed had previously ordered Goldman and Morgan Stanley to review foreclosures conducted by mortgage servicing businesses that the two investment banks bought in the run-up to the subprime mortgage crisis and have since sold.

Goldman had owned Litton Loan Servicing LP and Morgan Stanley owned Saxon Capital Inc.

In 2011 and 2012 the government required banks that collect payments on mortgages, known as servicers, to review loan files after widespread mistakes were discovered across the industry in the way they had processed home seizures.

The reviews were initially expected to determine which borrowers were harmed and compensate them based on their individual experiences, but the reviews proved slow and expensive.

Instead, some 220,000 borrowers whose homes were in foreclosure in 2009 and 2010 with Litton or Saxon will receive compensation ranging from hundreds of dollars up to $125,000 depending on the type of possible error, the Fed said.

(Reporting By Aruna Viswanatha; Editing by Gerald E. McCormick and Grant McCool)