After her emotional resignation statement on Friday morning, Theresa May retired to Downing Street for a few private, comforting words with her husband, Philip. Then she composed herself before calling in her Downing Street staff to say a final thank-you.

As she entered the No 10 meeting room, which was packed with between 30 and 40 people, most of whom had been with her throughout her premiership, loud applause and cheers rang out.

Less than half an hour earlier, many of these same officials and staff members – like much of the country – had crowded round televisions to watch her announce the date of her departure outside the front door of No 10. Some, like the prime minister herself, had broken down in tears.

Enough wishful thinking. The next PM must confront hard realities on Brexit Read more

But despite her swirling emotions, May still wanted to pay a personal tribute to those who had stuck with her through an extraordinarily turbulent premiership.

“It was very, very sad,” said one staff member. “She called us in and said she was sorry things had gone the way they had, but that she and all of us had done our best. She thanked us all for our work. She was composed and seemed OK, but it was difficult for everyone.”

Another who was there said May looked calmer than she had half an hour before, as if a huge weight had suddenly been lifted off her shoulders. But there was no disguising the pain of the moment, and the grim realisation among her team that a premiership that had lasted less than three years, and that had involved little but struggle and crises, was ending in total failure.

In July 2016, when Theresa May entered Downing Street for the first time, she set herself two main goals that both involved healing national divides.

The first, she made clear when addressing the nation on 13 July 2016, was to do more to help “ordinary working-class families” get on in life. She promised those familes that she would “think not of the powerful but you,” adding that the “government I lead will be driven not by the interests of the privileged few, but by yours”.

But it was her second goal - to deliver the Brexit that the British people voted for in 2016 - that was to consume almost all her time and energy and, in the end, bring her leadership of the country to its disastrous finale.

Will Tanner, who advised May from 2013 to 2017, said after watching her resignation speech that his former boss had always been spurred on by high-minded intentions and a sense of duty. But in the end she had been defeated by a confrontational political system that she deeply disliked, and brought down by colleagues who had refused to recognise the real-world need for compromise.

“Theresa was always a politician frustrated by the grubby deal-making of politics and in the end was unable to play the game,” Tanner said. “She will feel exasperated that others chose to posture while she tried to do the right thing, and regret the mistakes that she made – not least calling a general election in 2017. Having reached Downing Street to calm a gathering storm, she has been consumed by it.”

As Conservative MPs and ministers reflected on her downfall, many said that the most remarkable thing was that the May premiership had lasted as long as it had. “Over time she became defined not by her achievements but by her ability to hang on and survive everything that went wrong,” said one Tory minister who remained supportive of her to the end. “It is not quite the legacy she would have wanted.”

Facebook Twitter Pinterest May holding a press conference in Downing Street after winning a vote of confidence in her leadership of the Conservative party by 200 votes to 117. Photograph: Nils Jorgensen/Rex Shutterstock

Less than a year into her time at No 10, May had made arguably her worst of decision of all, to call a snap election in the hope of winning her own mandate to deliver Brexit – only to lose the Tories their majority and leave her dependent on the Democratic Unionist party to get legislation through the Commons. But somehow she staggered on, setting new standards for defiance with every month that passed.

She was to lose one foreign secretary (Boris Johnson), two Brexit secretaries (David Davis and Dominic Raab), and a string of other ministers in her vain pursuit of a Brexit deal that could unite the party and country. Last December, with the anti-EU Tory right increasingly mutinous, she survived a confidence vote of her own MPs, though 117 voted against her.

And on it went. The crises mounted. In January, May crashed to the biggest parliamentary defeat suffered by any prime minister in the modern era, and this was followed by several other crushing losses. Brexit had to be delayed not once but twice, from 29 March this year to the end of October.

Before Easter, a desperate May turned to Labour in an attempt to strike a cross-party compromise that would finally allow the UK to leave the EU and avoid it having to take part in European elections.

The opening of talks with Corbyn and the prospect of EU elections, however, left the Tory party in open revolt, and Nigel Farage and his new Brexit party stood ready to exploit the Tories’ and May’s woes. Then, 10 days ago, Labour pulled the plug on the cross-party negotiations, and the last hope that a Brexit deal could pass through parliament vanished. “That was effectively that for May. That was when no one could really pretend any more,” said a former Tory minister.

Except for May herself. In characteristic fashion, she refused to give up. Last Tuesday, she outlined to her cabinet one last “bold offer” on Brexit that she hoped would persuade enough MPs across the Commons to back her. The cabinet meeting lasted three-and-a-half hours. It was tense and fractious. Several ministers, including Andrea Leadsom, leader of the House of Commons, and Chris Grayling, the transport secretary, could not believe what May was now proposing as a means of trying to woo Labour, including the idea of a temporary customs unions and – more explosive still – a vote on whether to hold a second referendum.

It was so quiet in the chamber when she spoke. It was like the last rites. It's not normal for the House to be like that Former Tory minister

None of the cabinet ministers regarded as frontrunners in the race to succeed May as leader – including Jeremy Hunt, the foreign secretary – dared speak up for her ideas. Michael Gove, the environment secretary and Geoffrey Cox, the attorney general, expressed strong concerns about the referendum idea.

The next morning, Gove went public, casting doubt on whether the plan would ever be put to a Commons vote, as May still appeared still to intend to do. It was a clear signal that her cabinet was not prepared to back the prime minister’s last desperate throw of the dice.

When May then outlined her plans to parliament on Wednesday, there was almost no support from Tory MPs and none from Labour. A former minister said that he had never experienced a more deathly atmosphere in the Commons. “It was so quiet in the chamber when she spoke,” he said. “It was like the last rites. It is not good – or normal – for the House to be like that.”

Afterwards, a cabinet minister who had lived daily with May’s Brexit struggles since the late summer of 2016 said that there were now two options for the prime minister and both led to the same destination. She could force her new Brexit proposals to a vote in the Commons, in which case he thought she would almost certainly be defeated by upwards of 250 votes and be forced to resign. Or she could pull the vote, and by doing so tell MPs that a Brexit deal was now completely beyond her. It was, he accepted, “like choosing which of two routes you take to the guillotine for your own execution.” Another government minister said: “It is sad to see – but this time it really is over. She is dead now. It is just a case of when the life support machine is switched off.”

Some time late on Wednesday, after Leadsom had called the prime minister to say she was resigning – and following meetings with the chief whip, Julian Smith, and Sir Graham Brady, the chair of the 1922 Committee – May finally decided that enough was enough. But she only confided the decision to a very few aides, including her chief of staff, Gavin Barwell. She told them that she would delay an announcement until Friday, because Thursday was polling day in the European elections and it would be inappropriate to go public as voters were heading to the ballot boxes. On Thursday morning, Hunt and the home secretary, Sajid Javid, both went to see May to ask her not to push her plans to a vote. Hunt told her he felt it would be unfair on Tory MPs to ask them to back proposals that so many of their constituents would vehemently oppose. She listened politely but did not tell them of her resignation plans.

Facebook Twitter Pinterest Andrea Leadsom, the leader of the House of Commons, resigned from May’s cabinet on Wednesday. Photograph: Dan Kitwood/Getty Images

No sooner had May made her tearful statement on Friday, bringing the Tory war over her leadership to an unpleasant end, than a potentially even more ugly battle over the succession began in earnest. Johnson, the early favourite to enter No 10, set out his stall without delay, insisting that under his leadership Brexit would happen this autumn, no matter what. Playing to the hard-Brexit wing of the Tory party at Westminster and the 100,000-plus Tory members who will ultimately choose the new leader, Johnson said at a meeting in Switzerland: “We will leave the EU on 31 October, deal or no deal.”

By Saturday he had been joined by a lengthening list of candidates that included Hunt and Leadsom, former work and pensions secretary Esther McVey, health secretary Matt Hancock, and the new international development secretary, Rory Stewart. In a taste of things to come, Stewart tore into Johnson in a BBC radio interview on Saturday, saying that he could never work under the former foreign secretary because of his willingness to entertain a no-deal Brexit. Accusing Johnson, in effect, of being slippery, he said: “It pains me to say it. Boris has many, many qualities, but I talked to him a few days ago and I thought he had said to me that he was not going for a no-deal exit. He has now come out and said yesterday that he is going for something which I believe is undeliverable, unnecessary and is going to damage our country and economy.”

Writing in the Observer, the cabinet minister David Gauke, who will not stand in the contest, says there is now a danger of leadership candidates failing to deal with reality and indulging in wishful thinking as they seek the votes of Tory MPs and grassroots members.

The danger with this is that “big promises fail to be delivered, leaving the public yet more disilllusioned, angry and tempted by the snake oil of populism,” he writes. Anyone who backs a no-deal Brexit, he argues, should come clean with the country about the damage it would do. “We should not pretend that leaving the EU without a deal will be anything other than enormously harmful to our economy, weaken our security relationships and threaten the integrity of the union,” Gauke says, adding that the task that faces the next prime minister “will be the same one that Theresa May faced for three years”. In essence, he is warning that her departure will do nothing to solve the country’s problems – and could make them even worse.