Theresa May has announced her resignation after failing to sell her Brexit plan to Parliament, the nation, or even her own party.
She is the second successive Conservative leader brought down by her party's deep divisions over Europe.
In a speech outside Downing Street on Friday, the British Prime Minister said she left with "deep regret" at having failed to deliver Brexit, but "no ill will and enormous and enduring gratitude" for the honour of serving in the job.
Her voice cracking with emotion at the end of her speech, May said she had been "the second female prime minister but certainly not the last".
And May called for a spirit of compromise in politics, warning that her successor would have to find the consensus on Brexit that had eluded her.
Her resignation will take effect on 7 June, but she will serve as acting Prime Minister until her successor is chosen.
May had been trying to hang on to give her Brexit plan one more vote in the House of Commons, where it has been defeated three times already, in early June.
But it had become increasingly clear the plan does not have the support of much of her own party or the opposition.
It is unclear if the choice of date means she will be given that last chance.
Former foreign secretary Boris Johnson is now the favourite to win his party’s leadership, in a process expected to culminate in a vote of Conservative party members in July.
However the Tories have a habit of not giving the job to the favourite, and there is a crowded field of contenders.
After the speech, colleagues praised her dignified exit.
Johnson said: "Thank you for your stoical service to our country and the Conservative Party. It is now time to follow her urgings: to come together and deliver Brexit."
Another potential leadership candidate Michael Gove said the Prime Minister "deserves our respect and gratitude".
Her chief of staff Gavin Barwell said he had "seen at first-hand her commitment to public service and her incredible resilience as she has confronted the biggest challenge any British government has faced since the Second World War."
But May has not proven a success at the ballot box. At her first general election in 2017 the government lost its majority and had to limp on with the support of the Northern Irish DUP – which proved a major factor in the problem of delivering a compromise Brexit.
In recent council elections more than 1300 Tory councillors lost their seats.
And in the country's European Parliament elections, which took place on Thursday but whose results will not be known until Sunday, the Conservatives were expected to be deserted in droves by voters flocking to Nigel Farage's Brexit Party.
The choice of departure date means May is assured of outlasting Gordon Brown to claim the title of only the fourth shortest-serving post-war prime minister.
May's successor has until October 31 – the current Brexit deadline – to come up with a new plan.
The European Union has indicated its refusal to reopen the divorce deal that was signed late last year with May, governing the terms of the UK's departure from the EU and including the controversial Irish "backstop".
However it has said it would consider reopening the "political declaration" accompanying the deal, which sets out the aims and parameters of the UK's future trade and customs relationship with Europe.
The Labour opposition is likely to push for a general election, challenging any new leader's legitimacy and mandate.
Labour leader Jeremy Corbyn said: "“The Prime Minister is right to have resigned. She has now accepted what the country has known for months: she cannot govern, and nor can her divided and disintegrating party."
And the DUP will have a strong voice in the government's future, as they would renegotiate their deal with the next Conservative leader to deliver a majority in Parliament.