Mrs May won a confidence vote of the 317 Conservative MPs by a margin of 200 to 117 in a secret ballot on a dramatic evening in Westminster.
But she sowed the seeds for her eventual departure by telling Tory MPs that she would not lead the party into the next general election, expected in 2022.
She received strong public support from her Cabinet colleagues, with Chancellor Philip Hammond saying the vote of confidence was “the right one” and urging rebellious Tories to “focus on the future”.
But the number of MPs voting against their own leader prompted Jacob Rees-Mogg, leader of the pro-Brexit European Research Group, to describe it as a “terrible result” for the Prime Minister. And MP Andrew Bridgen said his party has “missed an opportunity” by not getting rid of her.
Speaking in Downing Street after the result was announced, Mrs May said: “This has been a long and challenging day, but at the end of it I’m pleased to have received the backing of my colleagues in tonight’s ballot.
“Whilst I’m grateful for that support, a significant number of colleagues did cast a vote against me, and I have listened to what they said. Following this ballot we need to get on with the job of delivering Brexit for the British people and building a better future for this country.”
The result means no further confidence vote can be held for another year.
Prior to the vote, Mrs May told her fellow Conservatives she would not lead the party into the next election in a move seen as an attempt to win the support of wavering MPs. She was also said to have promised to find a “legally binding solution” to ensuring that the UK does not get permanently trapped in a backstop arrangement to keep the Irish border open after Brexit.
Earlier in the day and minutes after the confidence vote was confirmed by the committee’s chairman Sir Graham Brady, Mrs May stood on the steps of Number 10 and vowed to fight “with everything I’ve got” to retain her place as Tory leader.
The vote was triggered on Tuesday night by a minimum of 48 Tory MPs, representing 15 per cent of the party’s total, writing letters of no confidence in her leadership.
The majority of Tory MPs in Yorkshire and the Humber went into the ballot having declared their support for Mrs May, with one saying the no confidence motion had been the result of “complete madness” by a minority of hardliners.
However, at least four MPs from the region, Philip Davies, Andrea Jenkyns, Martin Vickers and former Brexit Secretary David Davis said they would vote against the Prime Minister.
And the secret nature of the ballot led some, including Morley and Outwood MP Mrs Jenkyns, to claim that many of her colleagues who publicly backed Mrs May would oppose her when it came to the vote.
Andrew Jones, the Rail Minister and MP for Harrogate, was among those offering public backing and told The Yorkshire Post the party “would have to be barking mad to replace her”.
It came after a tumultuous few days for the Prime Minister, following her decision on Monday to delay the meaningful vote in the Commons on her Brexit deal in the face of a likely heavy defeat.
On Tuesday she visited The Hague, Berlin and Brussels for Brexit talks with European leaders in a bid to win assurances over the controversial Northern Ireland backstop, which many MPs opposed.
But her hopes of winning concessions which could persuade MPs were dealt a blow after a senior Brussels figure warned there was “no room whatsoever for renegotiation” of the agreement already reached between the UK and European Union.
Mike Cherry, chairman of the Federation of Small Businesses, said it was now “incumbent on Number 10 to find a way forward from the Brexit impasse and ensure there is not a disorderly no deal Brexit in just over 100 days”.