Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — Theresa May will become Britain's second female prime minister after her only challenger withdrew Monday from the race to lead the ruling Conservative party.

May had been competing with Andrea Leadsom to replace David Cameron as party leader after he announced he would quit after losing last month's Brexit referendum.

However, Leadsom announced Monday she was dropping out, leaving May unopposed and forcing the Conservatives to abandon their plans for a ballot of members.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Cameron said he would offer his resignation to Queen Elizabeth II Wednesday — a necessary formal step when changing leaders — meaning May would become leader the same day.

He told reporters outside No. 10 Downing St. he was "delighted that Theresa May will be the next prime minister ... she will have my full support."

May will be the country's second female PM and the first since Margaret Thatcher stood down in 1990.

It marked another turbulent day in British politics. At the exact moment that Leadsom withdrew from the contest, lawmakers in the opposition Labour Party launched an official challenge to their embattled leader, Jeremy Corbyn. Labour now faces a months-long leadership battle of the kind that the Conservatives have just avoided.

Theresa May, left, and Andrea Leadsom. Matt Dunham / AP

Under Britain's system of parliamentary democracy, a general election is not mandatory when an incumbent leader stands down. Three of the six prime ministers in the past 40 years have taken over after being nominated by their party or chosen by their fellow lawmakers in a ballot.

However, May's rise is remarkable because she backed the losing "Remain" side in the Brexit referendum. She pledged Monday that she would honor the victory of the 52% who voted 'Leave', telling reporters: "There will be no attempts to remain inside the EU."

The 59-year-old, who is currently Home Secretary and in charge of police, counter-terrorism and border controls, was always the favorite in the contest, with odds of 1/3 before Leadsom pulled out.

She was by far the more experienced candidate. Leadsom, a junior minister, emerged as an unlikely challenger after former London Mayor Boris Johnson declined to enter the leadership race. She drew criticism at the weekend after suggesting that she was better equipped to be prime minister because she had children and May did not.

"I feel being a mom means you have a very real stake in the future of our country, a tangible stake," she told The Times.

Although there is no requirement for a new general election, both Labour and the Liberal Democrats have called for one. Those demands could grow if May pushes ahead quickly with the process of withdrawing from the EU.