Stephen Hester, the chief executive of Royal Bank of Scotland (RBS), is to quit the taxpayer-backed lender this year in a move which diminishes the prospects of privatising the bank ahead of the next general election.

Mr Hester's exit, announced after the stock market closed on Wednesday, will see him leaving the bank with a payoff of up to £5.8m, comprising a year's salary of £1.6m from the date he departs and up to £4.2m in share awards.

The news of his departure comes two weeks after Sky News revealed that Sir Philip Hampton, RBS chairman, was drawing up a list of potential successors to Mr Hester.

His departure will enable the Treasury to appoint a new boss to lead the sell-off of the taxpayer's 81% stake in RBS, which is currently worth billions of pounds less than the Government paid to rescue the bank in 2008.

Mr Hester said he was "co-operating amicably" with the RBS board's decision to identify a successor but said his tenure at RBS had been "bruising".

He said: "It has been nearly five years since I joined RBS after the bank was rescued by the Government.

"In that time we have reduced the bank's balance sheet by nearly a trillion pounds, repaid hundreds of billions of taxpayer support, and removed the imminent threat that this bank's size and complexity posed to the UK economy.

The bank was rescued in 2008

"All the while we supported 30 million customers every day to help them manage their finances.

"We are now in a position where the Government can begin to prepare for privatising RBS. While leading that process would be the end of an incredible chapter for me, ideally for the company it should be led by someone at the beginning of their journey.

"I will therefore step down at the end of this year to allow a new CEO to lead the Group in this next stage.

"Over the coming months I will put all my effort into completing the final recovery and continuing to build a strong customer-focused culture. I thank all of the people of RBS for their support and wish them all the best for the future."

RBS chairman Sir Philip Hampton told Sky News: "If Stephen had arrived a year ago, he would have absolutely been the right man for privatisation.

"Stephen is an outstanding executive who has done an outstanding job at RBS, but can he really commit to another three or four years in another 18 months' time?

"And our judgement and Stephen’s judgement and indeed the Treasury's judgement was no that's pretty risky."

He added: "This change is part of the path to privatisation … Stephen has done a fabulous job in putting the bank back on its feet and it is now a good time to look for somebody else to take it forward."

George Osborne, the Chancellor, lavished praise on Mr Hester, saying: "When Stephen Hester took on the job at RBS in 2008 it was a bust bank with a broken culture and posed a huge risk to financial stability.

"RBS today is safer, stronger and better able to support its customers. I want to commend Stephen Hester for everything he has done to make this turnaround possible.

"The size and complexity of the bank has been significantly reduced, with a far greater focus on serving its UK customers. Stephen Hester has made an important contribution to Britain's recovery from the financial crisis."

Mr Hester's relationship with the Chancellor and Sir Philip had been strained in recent months, with one insider saying that the chairman briefed fellow directors last month that he had been "told to sack" Mr Hester by the Chancellor.