Royal Bank of Scotland (RBS) has agreed to pay $5.5bn in fine to settle claims of misselling residential mortgage-backed securities (RMBS) in the US before the global financial crisis.

The settlement with the Federal Housing Finance Agency (FHFA) relates to $32bn of toxic mortgage securities, which were sold to mortgage giants Fannie Mae and Freddie Mac between 2005 and 2007. RBS will pay $4.52bn to Freddie Mac and nearly $975m to Fannie Mae as part of the settlement agreement.

The bank will however be reimbursed $754m under agreements made with third parties, thereby lowering the overall settlement cost.

The recent fine will be mainly covered by existing provisions, RBS said. The bank will also take a $196m charge in its second quarter results owing to the settlement.

RBS CEO Ross McEwan said: “Today’s announcement is an important step forward in resolving one of the most significant legacy matters facing RBS and is further evidence of the determination of the bank’s leadership to put our remaining issues behind us.”

“This settlement is a stark reminder of what happened to this bank before the financial crisis, and the heavy price paid for its pursuit of global ambitions.”