NOT surprisingly, it ended in tears for Theresa May.

After presenting a face of calm control during three years of a tortuous Brexit process, the “Maybot” mask in the final seconds fell away.

As the Prime Minister ended her resignation speech in a sunlit Downing St, watched on by husband Philip and close aides, she declared how it had been an honour “to serve the country I love”. With that her voice cracked and her eyes welled up as she turned to go back through No 10’s famous black door.

Inside, there was more emotion as, addressing staff, she thanked them all, paid tribute to her husband, whom she described as her “rock,” and teared up again, saying of her time in office: “It's been a journey.”

After weeks of trying and failing to find a Brexit compromise with Labour, it was the threat of a Cabinet mutiny on her reworked withdrawal Bill and the prospect of the party’s backbench 1922 Committee staging another confidence motion in her leadership, which eventually forced Mrs May's hand.

Addressing a barrage of cameras, the PM insisted she had "done my best" to deliver Brexit but, almost three years since the UK voted to break away from the Brussels bloc, she accepted that she had failed.

"It is, and will always remain, a matter of deep regret to me that I have not been able to deliver Brexit. It will be for my successor to seek a way forward that honours the result of the referendum," she said, stressing: “Such a consensus can only be reached if those on all sides of the debate are willing to compromise."

At the end of her speech, emotion broke through. "I will shortly leave the job that it has been the honour of my life to hold; the second female prime minister but certainly not the last.”

And with her voice cracking, she added: "I do so with no ill-will but with enormous and enduring gratitude to have had the opportunity to serve the country I love."

In response, Jeremy Corbyn insisted Mrs May's replacement should call an immediate general election. "The last thing the country needs is weeks of more Conservative infighting followed by yet another unelected prime minister,” declared the Labour leader.

Nicola Sturgeon echoed the point, saying: “Putting another Tory leader in Downing St without a general election is not the solution to this crisis. The only way to resolve Brexit is to put the issue back to the people.”

When the First Minister heard of Boris Johnson’s response to the PM’s speech, praising her “stoical service” to party and country, the First Minister tweeted: “What a hypocrite.”

Conservative colleagues rallied round their departing leader. Michael Gove, the Environment Secretary, said she "deserves our respect and our gratitude".

Scottish Conservative MP Andrew Bowie, who is the PM’s Parliamentary Private Secretary, told The Herald: “It has been the privilege of my life to serve such a dedicated, loyal, patriotic and thoroughly decent woman, who again showed today why we have been so lucky to have her as leader of our party and our country.”

But his Brexiteer colleague Mark Francois struck a different note. "It's because she didn't listen to her party or her colleagues that in the end the Dancing Queen has met her Waterloo."

Mrs May will end her time as Tory leader on Friday June 7, just 48 hours after the state visit of the US President Donald Trump. She will continue as an MP.

Her resignation will initiate a potentially bruising contest to succeed her with 12 or even more candidates taking part. Nominations will close in the week of June 10.

Jeremy Hunt, the Foreign Secretary, announced his candidacy shortly after the PM’s statement, joining others who have already declared, including Scot Rory Stewart, the International Development Secretary, and Mr Johnson, who is the bookies’ favourite.

Initial votes among MPs will whittle the candidates down to just two, who will then embark on a series of hustings across the country. Some 120,000 party members will make the final choice.

Brandon Lewis, the Conservative Chairman, said the aim would be to have the contest over by the time of Westminster’s summer recess. This is likely to mean the new PM will be in Downing St by July 19.

With the Commons arithmetic unchanged, he or she will face the same mighty task of getting MPs’ approval for a Brexit deal before the current EU deadline runs out on October 31.