David Cameron has voiced sympathy for Theresa May over her “painful” decision to stand down as Prime Minister.

The former premier alluded to his own resignation as he paid tribute to the spirit of “duty and service” which had driven her time in office.

“Theresa is right that compromise is not a dirty word and she should be thanked for her tireless efforts on behalf of the country,” he said in a statement.

“I know how painful it is to accept that your time is up and a new leader is required. She has made the right decision – and I hope that the spirit of compromise is continued.”

Speaking later in Oxfordshire, where he used to be an MP, he added: “I know what it feels like when you come to realise that your leadership time has finished, that the country needs a new leader.

“It is extremely difficult and painful to step outside of Downing Street and say those things. This will be a very difficult day.”

The former premier no doubt recalled another sunny morning three years ago when he emerged onto the steps of No 10 to declare the country needed “fresh leadership” after dramatically voting to leave the EU.

“I will do everything I can as prime minister to steady the ship over the coming weeks and months but I do not think it would be right for me to try to be the captain that steers our country to its next destination,” he said.

But while he spoke then of the need for “stability”, the legacy he left behind of a party and a country divided, was one that proved impossible for his successor to overcome.

With the spirit of compromise hard to find among the warring factions on Brexit, it remains to be seen whether a new leader can find a way of healing the deep divisions which have opened up.