Royal Bank of Scotland said Thursday it has agreed to pay $4.9 billion to settle U.S. claims that it misled investors who bought securities backed by risky mortgages in the run up to the 2008 financial crisis.

The tentative settlement with the U.S. Department of Justice marks a watershed moment for RBS, which was bailed out by British taxpayers after a series of acquisitions briefly made it the largest bank in the world before it collapsed a decade ago. The British government insisted that the U.S. claims had to be resolved before it could sell its 72 percent stake in RBS.

The agreement will “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,” CEO Ross McEwan said. “Removing the uncertainty over the scale of this settlement means that the investment case for this bank is much clearer.”

RBS shares rose as much as 6.6 percent in London trading after RBS announced the settlement, which was well below the $12 billion some analysts had forecast. RBS said it had already set aside $3.46 billion to cover the settlement, and it will take an additional charge of $1.44 billion in the second quarter.

“This will help the government to sell a cleaner bank,” McEwan said.

But McEwan stressed that the timing of selling the stake is in the government’s hands. Britain’s Treasury chief, Philip Hammond, welcomed the agreement in principle.

RBS is just the latest bank to settle Justice Department allegations that they misled investors about mortgage-backed securities, helping trigger the financial crisis. JPMorgan in November agreed to pay $13 billion, the largest settlement in U.S. history. RBS’s British rival, Barclays agreed to a $2 billion agreement in March.

The proposed settlement is still subject to both sides entering a legally binding agreement, RBS said.

The bank last year settled a similar case with the U.S. Federal Housing Finance Agency, the conservator of Fannie Mae and Freddie Mac, for $5.5 billion.

© The Associated Press. All rights reserved