Royal Bank of Scotland plc  (RBS) shares rose Wednesday after it reached a settlement with the Federal Housing Finance Agency (FHFA) over allegations of fraudulent conduct in the sale of mortgage backed securities before the financial crisis. 

Under the terms of the agreement the state-owned British lender will pay US$5.5 billion to settle with the FHFA, who will then withdraw all ligitgation claims against it.  The settlement amount is largely covered by an existing provision of $4.55 billion carried on the RBS balance sheet and, after accounting for third party indemnification agreements which are worth $754 million to RBS, will mean the bank only has to take a $196 million charge when it reports second quarter results next month.

RBS stock rose more than 3% to trade at an intraday high of 264.7 pence during the London session, taking its year to date return to around 18%, before the shares paired gains to trade around 1.40% higher. The Stoxx Europe 600 Banks index was 0.99% higher in noon trading.

Despite the resolution of FHFA claims RBS is not completely out of the woods as it still faces a criminal investigation from DoJ.

"RBS is not making any other adjustments to existing provisions relating to RMBS matters as a result of today's settlement but continues to advise that further substantial provisions and costs may be recognised and, depending upon the final outcomes, other adverse consequences may occur," the bank said in a statement. 

RBS still has around $3.8 billion in provisions for further settlements over mortgage bond related litigation however, it is thought that this still might not be enough to cover the cost of an eventual deal with the DoJ. 

Briefly the world's largest bank by assets, RBS is the world's largest surviving underwriter of mortgage backed securities, having taken second place only to Lehman Brothers and Bear Stearns ahead of the financial crisis.

Accordingly, it has been widely expected to take the biggest hit from the DoJ when the agency eventually gets around to dealing with it.