Image caption JP Morgan is one of the biggest investment banks in the world

US investment bank JP Morgan has agreed to pay $4.5bn (£2.8bn) to investors who lost money on mortgage-related securities during the financial crisis.

The settlement is with 21 major institutional investors.

Mortgage-related investments were a major factor in the crisis, which began in 2007 with the collapse of the US housing market.

Last month JP Morgan agreed a separate, preliminary $13bn deal with the US government over mortgage securities.

As part of that deal $5.1bn would go to settle charges that the bank misled mortgage giants Fannie Mae and Freddie Mac during the housing boom. That settlement was the biggest ever by a US bank.

Now, 21 institutional investors that put money into more than 300 residential mortgage-backed securities are to be reimbursed by the bank.

The securities in question were issued between 2005 and 2008 by JP Morgan and Bear Stearns - a bank which it took over during the financial crisis.

"This settlement is another important step in JP Morgan's efforts to resolve legacy related... matters" stemming from mortgage-related securities, JP Morgan spokeswoman Jennifer Zuccarelli said in a statement on Friday.

Friday's deal still has to be accepted by trustees for the trusts that hold the securities.

A final settlement with the US Justice Department is expected to be announced soon.

Mortgage-backed securities were sophisticated financial products created by many investment banks in the run-up to the financial crisis.

These special bonds contained a mix of investments but at their heart were supposed to be risk-free home loans.

When the housing bubble burst, the value of these assets fell sharply and the credit markets seized up. The balance sheets of many US and European banks, including those in the UK, became toxic and they had to be bailed out by their governments.

What JP Morgan is alleged to have done was sell the mortgage-backed assets knowing full well that many of the home loans were in fact very risky.