May, who announced her departure two weeks ago after her career was undone by the Brexit mess, formally stepped down in a private exchange of letters with the party, leaving nearly a dozen Conservative contenders fighting to replace her and resume the stalled quest to lead Britain out of the European Union.
She had said in an emotional press conference that she was sad because she has not been able to pass her Brexit deal through the parliament in three attempts.
After handing the letter to security inside Downing Street, the Brexit Party leader said: "We've got 55 days now of total impasse, while the government spends all its time working out who the next prime minister is".
Despite the loss, Farage said the result showed British politics had "fundamentally changed", with the stranglehold of the long-dominant Conservative and Labour parties now broken.
Esther McVey, who has promised as leader she would "embrace" a no-deal Brexit, said: "The result in Peterborough is the shape of things to come if we don't deliver a clean Brexit on October 31".
She was forced by her party to agree to set out a timetable for her departure, but asked for time to give lawmakers a fourth chance to vote on the agreement in early June. The Conservatives, who came second in the 2017 snap election, saw their share of the vote fall by 25 percent.
Mr Trump has been highly critical of Mrs May's Brexit strategy and ahead of his visit to Britain, urged her successor to leave the bloc with no deal if necessary.
After Theresa May resigned as Prime Minister on May 24, Labour leader Jeremy Corbyn called for a general election. The other strong contenders are the current foreign minister, Jeremy Hunt, who's running on his businessman credentials and positioning himself as a compromise candidate, and Dominic Raab, a former Brexit minister, who's trying to compete with Johnson as the most muscular and hardline Brexiter.
The final two candidates will meet in a runoff that will be decided in a mail-in vote by the country's approximately 160,000 Conservative Party members.
May has been prime minister for almost three years since she took over from David Cameron in the wake of the June 2016 Brexit referendum.
But the chances that Britain's 27 European Union partners would consider reopening the legally binding divorce agreement appear slim at best.
Most economists and businesses say a no-deal Brexit would cause economic turmoil, imposing obstacles overnight between the United Kingdom and the European Union, its biggest trading partner.
The Peterborough election was triggered when Labour's Fiona Onasanya became the first member of parliament to be ousted in a recall petition, after she was jailed for lying about a speeding offence.
One political commentator said it means the crucial job of picking May's successor will be made by "a group of elderly people around the country", a reference to much of the Conservative Party's membership. "I look back and I think I wish I hadn't done that", he said.