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 deals help the financial industry move a step closer to ending the housing crisis-related problems that have dogged it for years.

Morgan Stanley's portion of the settlement is $227 million, according to a person familiar with the agreement, including $97 million in cash and $130 million in the other measures. Goldman will pay $330 million, with $135 million in cash and $195 million from the other pot.

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.

Also on Wednesday, Goldman reported fourth-quarter profit of $5.60 per share, boosted by lower compensation combined with big revenue gains. [ID:nL1E9CG1FK] It shares were up 2.8 percent at $139.35 on Wednesday on the New York Stock Exchange.

Regulators said last week the payouts will be based on whether a borrower falls into one of 11 categories. The categories include whether the person was eligible for protections under the Servicemembers Civil Relief Act, whether the borrower was not in default, or whether he or she was denied a loan modification.

The Fed and the OCC are expected to reach similar agreements with other servicers that had been asked to conduct the reviews, including HSBC Holdings Inc, Ally Financial Inc, EverBank Financial Corp and OneWest Bank FSB.

Morgan Stanley said it was pleased to have settled the matter. A Goldman representative had no immediate comment.

Eligible borrowers should be contacted by the end of March with payment details, the Fed said.

(Editing by Gerald E. McCormick, Grant McCool and Matthew Lewis)

By Aruna Viswanatha