Royal Bank of Scotland has agreed a £3.6bn settlement with US regulators, paving the way for the government to sell its 72% stake in the lender.

RBS described the penalty, a result of claims it missold toxic mortgage bonds ahead of the 2007 financial crisis, as a milestone.

RBS said £2.5bn of the civil settlement will be covered by existing provisions and the bank will take a £1.1bn hit in its second-quarter results.

But the settlement still needs to be finalised, with further details set to be negotiated.

RBS chief executive Ross McEwan said: "Today's announcement is a milestone moment for the bank.

"Reaching this settlement in principle with the US Department of Justice (DoJ) will, when finalised, allow us to deal with this significant remaining legacy issue and is the price we have to pay for the global ambitions pursued by this bank before the crisis."

The latest settlement follows a £4.1bn penalty agreed with the US Federal Housing Finance Agency last July.

The settlements have weighed heavily on the bank amid fears over the size of the deals.

RBS is one of the last to settle with US regulators and the delay has been a major barrier to the bank's return to private hands. The UK Government previously said misselling claims needed to be resolved before its shares could be sold.

Shares in RBS surged 4% after the overnight settlement announcement.

Neil Wilson, chief market analyst at Markets.com, said: "It's a happy day for RBS, with the DoJ settlement coming in well below what we had feared.

"Of the $4.9bn, around $3.5bn has already been provided for so the impact on future earnings appears to be at the very low end of expectations. The settlement could easily have been twice as much.

"This removes the last great barrier to the government selling off its stake and we would envisage that the chancellor will expedite the disposal of its shareholding."