The investment bank JP Morgan has agreed to pay $5.1bn over its sale of risky mortgage backed securities - a key factor in the collapse of the US housing market in 2007.

It is the biggest-ever settlement so far by a US bank.

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

In a statement, JP Morgan said this latest deal resolves the biggest case against the firm relating to mortgage-backed securities.