Leadsom withdrew after a weekend uproar over comments she made suggesting that being a mother would be an advantage in the job

Receive the latest national-international updates in your inbox

British Home Secretary Theresa May launches her Conservative party leadership campaign at the IET events venue on July 11, 2016 in Birmingham, England.

A political era ended Monday — unexpectedly and without an election — as Prime Minister David Cameron said he will step down in two days in favor of Theresa May, a senior member of his Cabinet who will become Britain's second female leader.

Cameron announced his resignation last month because he backed the losing side in a referendum for Britain to leave the European Union. So did May — but infighting, bad timing and cold feet among leaders of the victorious "leave" campaign means that she will have the task of leading a divided country out of the EU.

The latest chapter in the political turmoil spawned by the EU vote moved with breathtaking speed.

On Monday morning, there were two candidates to lead the governing Conservative Party. At noon, Andrea Leadsom stepped down, making May leader-in-waiting. By late afternoon, Cameron had announced that May would be moving into 10 Downing Street within 48 hours.

"We will have a new prime minister in that building behind me by Wednesday evening," Cameron said in a brief statement outside the leader's official London residence.

Cameron, who has governed since May 2010, said he would offer his resignation to Queen Elizabeth II at Buckingham Palace on Wednesday after attending a final session of Prime Minister's Questions in the House of Commons. The monarch will then invite May — as leader of a party with a majority in Parliament — to lead a new government.

Speaking outside Parliament surrounded by Conservative colleagues, May said she was "honored and humbled" to have been chosen the party's new leader.

May campaigned tepidly to remain in the EU, but sought to reassure those who voted "leave" that she would respect their decision. She said there would be no attempt to avoid a British exit from the bloc.

"Brexit means Brexit, and we're going to make a success of it," she said, promising to deliver "a strong, new positive vision for the future of our country."

May's sudden victory came when Leadsom, the energy minister, stepped down from the Conservative leadership race after a weekend furor over comments in which she appeared to say being a mother gave her an advantage over May, who has no children.

Only a week after she announced she was running, Leadsom said she had concluded she lacked "sufficient support" among legislators to be leader. She said "the interests of our country are best served by the immediate appointment of a strong and well-supported prime minister."

Cameron's resignation announcement the day after the June 23 referendum triggered the Tory leadership race. The most prominent contenders to replace him — including "leave" campaign leaders Boris Johnson and Michael Gove — withdrew or were eliminated from contention one by one amid allegations of treachery and scheming.

Conservative lawmakers narrowed the field from five contenders to just Leadsom and May. Some 150,000 party members were due to choose between them in the coming weeks, with the result to be announced in September.

But with Leadsom's withdrawal, the party announced that May would be the new leader "with immediate effect."

May, 59, is one of the most experienced ministers in Cameron's Cabinet, serving for six years in the notoriously difficult job of home secretary, akin to the interior minister's post in other countries. She has a reputation for solid, unflashy competence and for prevailing over her rivals. Former Justice Secretary Kenneth Clarke was caught on microphone last week telling a colleague, "Theresa's a bloody difficult woman — but you and I worked for Margaret Thatcher."

The comparison with Thatcher, the "Iron Lady" who governed from 1979 to 1990 and refashioned Britain in line with her free-market ideology, appeals to many Tories.

Leadsom's decision to quit came after the weekend uproar over her comments about the role of motherhood in politics. She at first defended, then apologized for, an interview in which she said that being a mother "means you have a very real stake in the future of our country."

Before her announcement, Leadsom apologized to May, telling the Daily Telegraph newspaper that she believed having children has "no bearing on the ability to be PM."

Leadsom's rivals said both her comments on motherhood and her subsequent flip-flopping showed she lacked the experience under pressure required to be prime minister. Her allies accused May supporters of trying to undermine Leadsom.

The Conservatives aren't the only ones thrown into turmoil by the referendum, which has also sparked a leadership struggle in the main opposition Labour party.

Labour lawmaker Angela Eagle launched an attempt to unseat party leader Jeremy Corbyn, a staunchly uncharismatic socialist who has a strong base of support among Labour members but little backing from the party's 229 lawmakers.

Labour legislators have passed a no-confidence motion in Corbyn, and many of his top team in Parliament resigned from their jobs to protest his leadership. He is refusing to resign and says he can win a leadership battle, which would be decided by a vote of party members.

May's accession is unlikely to end the political turbulence. She will be under immediate pressure to launch two years of formal exit talks with the EU by triggering Article 50 of the bloc's constitution.

She also faces calls to seek a mandate from voters well before the next scheduled national election in 2020, although there is no legal requirement for her to do so.

Oliver Daddow, senior lecturer in politics at Nottingham Trent University, said May would be well advised to call a snap election while Labour is in disarray.

Senior Conservatives quickly rallied around the new leader after the referendum campaign, which widened the party's longstanding split over Europe. Gove, the justice secretary, said May "has my full support as our next prime minister," while Johnson, the former London mayor, said she would "provide the authority and the leadership necessary to unite the Conservative Party and take the country forward."

May's honeymoon may be short-lived. She faces the possibly insurmountable challenge of negotiating a new relationship with the EU that can satisfy Brexit-supporting Britons, disappointed "remain" voters and the 27 remaining members of the bloc. She will have to balance access to the EU's single market, which the economy has come to rely on, with immigration controls that the "leave" campaign promised.

"She is in a position of leading a country which wants to have its cake and eat it — which wants to leave the EU but yet have access to the single market without free movement of people," said Tim Bale, professor of politics at Queen Mary, University of London. "The idea that she is going to be able to satisfy everybody I think is far-fetched. That reckoning is two years or so down the line, but it is a reckoning that will eventually come."