Prime minister remains in office until successor has been chosen by her party

Theresa May has given an emotional farewell to “the job that it has been the honour of my life to hold”, pledging to step aside as Conservative leader on 7 June and kicking off a frantic scramble to become Britain’s next prime minister.

Calling time on a turbulent three-year premiership punctuated by revolts and resignations, May said she would leave “with no ill will, but with enormous and enduring gratitude to have had the opportunity to serve the country I love”.

The prime minister will remain in place until a new leader has been chosen by her party: a process senior Conservatives hope will be completed by late July.

Boris Johnson is the frontrunner to succeed May, but he will be one among a crowded field of contenders, with the foreign secretary, Jeremy Hunt, declaring his candidacy on Friday. A host of others are expected to follow.

Johnson was quick out of the blocks after May’s resignation, insisting the UK must leave the EU on 31 October, “deal or no deal”, in an attempt to shore up his appeal to the right of the party.

With Nigel Farage’s Brexit party expected to perform strongly when the results of the European elections are revealed on Sunday night, prime ministerial candidates will come under intense pressure to take a tough stance on Brexit.

In her statement outside 10 Downing Street, May said: “It will always remain a matter of deep regret to me that I have not been able to deliver Brexit”. She insisted, however, that she had pursued the right strategy until the end.

In her speech, which aides said she had largely written herself, the prime minister listed a number of what she said were her government’s achievements, including the race disparity audit and the public inquiry into the Grenfell Tower disaster.

But the Fire Brigades Union reacted angrily to her mention of the fatal fire, with the general secretary, Matt Wrack, saying: “Many of the underlying issues at Grenfell were due to unsafe conditions that had been allowed to fester under Tory governments and a council for which Theresa May bears ultimate responsibility.”

Former prime minister David Cameron offered his sympathy to May, saying, “I know how painful it is to accept that your time is up and a new leader is required.

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

Despite the bullishness of the Brexiters about the difference a new leader could make, EU27 leaders responded to May’s departure by underlining their determination to stick to the withdrawal agreement they signed off late last year.

Mark Rutte, the Dutch prime minister, offered his thanks to May, but added: “The agreement reached between the EU and the United Kingdom for an ordered Brexit remains on the table.”

A spokeswoman for Jean-Claude Juncker said the European commission president had followed May’s tearful statement “without personal joy”, and described her as a “very courageous woman”.

She added that Juncker would treat any new prime minister with the respect shown to May, but that the commission’s position – that negotiations were closed – would not change.

David Davis, the former Brexit secretary, who is backing his successor, Dominic Raab, said: “The chance is now available for a new leader to reset, and if they take no deal seriously, if they go back and promote the compromises that parliament has agreed, there’s a decent chance of leaving by the October deadline, moving on to a more sensible basis of negotiations thereafter for the future deal, and getting Britain back worrying about the things that matter: housing, education, health services and the like.”

Davis said he was sad for May. “I thought she was overwhelmed by a really impossible situation, but in other respects she was a very good prime minister.”

Play Video 2:01 As Theresa May resigns, how will she be remembered? – video

Moderate Conservative MPs hope they can halt the momentum behind the Johnson campaign. The former health minister Steve Brine, who is backing Hunt, said the new leader must pursue “centrist policies in the centre ground of British politics which, so far as I know, is the only place from which elections are won in our country”.

Allies said May decided on Wednesday night that she had to resign, as support for her “new” 10-point Brexit deal drained away.

They played down the impact of hostile interventions by individual members of the cabinet, saying: “We had made our move – it was probably the only move we had left.”

Andrea Leadsom resigned from the cabinet on Wednesday evening rather than present May’s new deal to parliament as the leader of the House of Commons; and Hunt and Sajid Javid demanded one-to-one meetings to tell her they could not support the package.

In a speech at the business consultancy firm PWC in London on Tuesday, May set out a series of compromises she was prepared to make to win the support of MPs on both sides of the Commons, including a vote on holding a second referendum.

The string of pledges failed to persuade Labour or the Democratic Unionists, and alienated Tory backbenchers who were furious about the impact of the referendum pledge on voters just before tough European elections.

Timeline Six key Brexit moments for Theresa May Show Hide Theresa May is elected Conservative leader and, having backed remain, seeks to burnish her credentials as someone who can unite her party by appointing key leave figures to the cabinet, including Boris Johnson as foreign secretary, Liam Fox as trade secretary and David Davis as Brexit secretary. In her first conference speech, May sets a course for a hard Brexit by vowing 'we are going to be a fully independent, sovereign country' and implies the UK will leave the customs union and the single market. Three months later, she delivers the Lancaster House speech that inked her red lines in permanent marker and left her with little room for manoeuvre. Having decided to call a snap general election in order to garner a majority that would allow her to push her Brexit vision through the Commons, a calamitous campaign results in the Conservatives losing their majority. That left May not only turning to the DUP in order to prop up her government but set the scene for the parliamentary deadlock that was to come. May gathers her warring cabinet at Chequers in a bid to set out a compromise negotiating position that has a chance of finding favour with the EU. But a perceived move towards a softer Brexit provokes an immediate backlash from the right of the party, prompting the resignations of Davis and Johnson from the cabinet and new plotting from ERG members. With her deal having been voted down by a crushing 230 majority when she first brought it before the Commons in January, May tries again with 19 days left until the original Brexit date. She is again humiliated when the deal is beaten by a majority of 149 votes, as the process becomes mired in parliamentary paralysis. After weeks of fruitless talks with Labour over a Brexit compromise, May launches her 'new' Brexit plan, with 10 commitments designed to address cross-party concerns about her withdrawal agreement bill. Cabinet agrees to the plan, but Andrea Leadsom resigns as the leader of the House of Commons. By the end of the week, May has been forced to announce her departure.

May returned to her Maidenhead constituency shortly after announcing her resignation and will spend the weekend at Chequers, the prime minister’s country retreat.

Jeremy Corbyn said May had done the right thing by resigning and called for a general election, something many at Westminster believe is increasingly likely if the aspirations of a new Tory leader clash with the party’s lack of a majority in parliament.

The Labour leader said: “The last thing the country needs is weeks of more Conservative infighting followed by yet another unelected prime minister.

“Whoever becomes the new Conservative leader must let the people decide our country’s future through an immediate general election.”