U.K. Prime Minister Theresa May on Friday announced her resignation, putting an end to months of speculation over her future because of her handling of Brexit.

“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 on June 7.

“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.”

An election within the Conservative Party now will commence to determine who takes over as party leader. That person also will become prime minister, as the Conservatives are still the largest party in the House of Commons despite months of infighting.

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.