"It is now clear to me that it is in the best interests of the country to have a new prime minister," May told reporters.
She said she will be resigning as leader of the Conservative Party on June 7. She will remain as prime minister until a new leader is elected from within the party.
"It is a matter of deep regret that I have not been able to deliver Brexit," May added. "My successor will have to find a consensus. Consensus will only be possible if those on both sides of the debate compromise."
Toward the end of her speech, May's voice cracked and she appeared on the verge of tears, adding: "It's been the honor of my life to serve the country I love."
Reactions were mixed but broadly respectful.
An election within the Conservative Party now will commence to determine who takes over as party leader, with a chance to vote before the end of July, according to the BBC.
That person also will become prime minister, as the Conservatives are still the largest party in the House of Commons despite months of infighting.
A leadership campaign will now take place, and Conservative Party members will have the chance to vote on who the next leader will be before the end of July, according to the BBC.
May's authority has looked increasingly shaky in recent months. Her Brexit deal, which she spent the better part of three years negotiating and re-negotiating, has been rejected by lawmakers three times this year.
She previously said she'd would resign if her Brexit deal was passed, but now she's bowing to pressure from lawmakers within her own party to resign before a deal is again put up for a vote.
A speech on Wednesday in which May unveiled a new plan to get her Brexit deal through Parliament included a vote for lawmakers on "on whether the deal should be subject to a referendum."
This proved to be deeply unpopular with Brexit-supporting members of her own party, including MP Boris Johnson, who said on Tuesday that while he'd previously backed May's deal with "great reluctance," he couldn't support her new plan.
Johnson announced his intention to run for prime minister once May steps down. Others expected to run include Dominic Raab, Esther McVey and Matt Hancock.
Whoever assumes control still must resolve key issues around Brexit.
The U.K. is set to leave the EU on Oct. 31, but the country's political future has never looked more uncertain.
Nigel Farage, leader of the newly formed Brexit Party who advocated for a "no deal" exit from the EU and who recently has been threatened with milkshakes, said the Conservative Party must change its position to a harder Brexit "or it dies."
It is difficult not to feel for Mrs May, but politically she misjudged the mood of the country and her party. Two Tory leaders have now gone whose instincts were pro-EU. Either the party learns that lesson or it dies. — Nigel Farage (@Nigel_Farage) May 24, 2019
"It is difficult not to feel for Mrs May," Farage posted to Twitter, "but politically she misjudged the mood of the country and her party."