London (CNN) British Prime Minister David Cameron is to resign Wednesday, paving the way for Home Secretary Theresa May to take the reins.

May was officially named Conservative Party leader and successor to Cameron "with immediate effect" Monday, said Graham Brady, chair of the 1922 Committee, a collection of Conservative members of Parliament key to electing the party leader. She will replace Cameron on Wednesday evening.

In remarks shortly after her leadership was affirmed, May said her priorities will be to administer Britain's exit from the European Union, a move approved by voters last month, to unite the country and to create a "strong, new, positive vision for the future," not just for the privileged few, but for everyone.

Cameron had already announced he would step down by October after failing to convince the country to remain in the EU in the divisive June 23 referendum that sent shockwaves through Britain's political establishment.

But Monday, May's only remaining rival to replace Cameron -- Energy Minister Andrea Leadsom -- pulled out of the race following controversy over comments she made about motherhood and leadership.

"Obviously, with these changes, we now don't need to have a prolonged period of transition. And so tomorrow I will chair my last Cabinet meeting. On Wednesday I will attend the House of Commons for Prime Minister's questions," Cameron told reporters Monday outside 10 Downing Street.

"And then after that I expect to go to the palace and offer my resignation. So we will have a new prime minister in that building behind me by Wednesday evening."

The vote between May and Leadsom was supposed to go to the wider Conservative Party of 150,000 people, but being the sole candidate, May sidestepped the party rule.

Cameron welcomed Leadsom's decision to drop out of the race and said he was confident May would steer the country in the right direction, calling her strong and competent, and offering her his full support.

Is this democratic?

May became the last one standing for a job no one else really wanted.

It is the latest twist in Britain's political saga that ensued after the "Brexit" vote.

May, who supported Britain remaining in the EU, reiterated her commitment to Brexit on Monday.

"Brexit means Brexit, and we're going to make a success of it. There will be no attempts to remain inside the EU. No attempts to rejoin it by the back door. No second referendum. The country voted to leave the European Union, and as prime minister, I will make sure we leave the European Union," she said.

The country is entering uncharted territory -- it is unprecedented for a candidate in Britain to run unopposed at this stage of a leadership change, and May's quick succession to the country's leadership is raising questions about the whole process. How can a leader be democratically chosen by so few people?

Some 329 Conservative members of Parliament voted to whittle down five candidates to two for their party's leadership, but it seems the 150,000 party members who were supposed to have the final say will have no input in it at all.

In Britain's parliamentary system, the leader of the ruling party is automatically made prime minister.

"There is an absurdity in the system that a prime minister can be chosen by people who are supporters of one party when it is in government," CNN political contributor Robin Oakley said.

"There will undoubtedly be some frustration in the public, but there's nothing much that can be done. There was a reasonable process in place, but if the last contender doesn't have the stomach for a fight, this is how things will be decided."

Some complained on Twitter that they were being left out of the whole process and demanded a general election.

If #Corbyn is not allowed on ballot and #May does not call a General Election British democracy will be officially dead. — Cham Payne (@Calamity_Payne) July 11, 2016

Go out for a couple of hours and come back to discover that the awful, right wing, authoritarian Theresa May is new PM. Democracy is great. — Darren Parlett (@DarrenParlett) July 11, 2016

Tim Farron, leader of the Liberal Democrats, also tweeted his objections.

"The Tories now have no mandate. Britain deserves better than this," he said.

Councilor Usman Ahmed of the opposition Labour Party also called the system undemocratic.

With @TheresaMay2016's coronation we need an early General Election. The Tories now have no mandate. Britain deserves better than this. — Tim Farron (@timfarron) July 11, 2016

But the Labour Party isn't offering any greater stability. It is suffering a leadership earthquake of its own, with Angela Eagle, a senior member in the party, officially launching a challenge to leader Jeremy Corbyn on Monday.

Corbyn became leader after Labour lost the last election, and the masses adore him for bringing tens of thousands of new members from the left into a party accused of being too centrist.

A Prime Minister chosen by 150,000 people in a country of 64,928,787 in anything but democratic & Britain must now have a General Election — Cllr Usman Ahmed (@CllrUsmanAhmed) July 7, 2016

For the same reason, he has struggled to bring his members of Parliament together, the majority seeing him as unrealistic and unelectable.

Leadsom faced criticism

Leadsom, the energy minister, conceded Monday she would have struggled to unite the party had she been elected.

"Theresa May carries over 60% of support from the party. She is ideally placed to implement Brexit and has promised to do so. I have concluded that the interests of our country are best served by the implementation of a strong leader," Leadsom said.

"I am therefore withdrawing from the leadership election," she said, adding that she gave May her "full support."

Leadsom's withdrawal from the race came in the face of pressure from a faction of lawmakers in the warring Conservative Party.

The energy minister has drawn fierce criticism in the past week, accused of exaggerating her professional experience and asserting she could run the country better than May because she is a mother.

Daunting job

The new prime minister faces the daunting job of negotiating a deal with an angered EU, one that does not cripple the British economy and keeps the country on friendly terms with neighbors.

JUST WATCHED David Cameron talks Brexit Replay More Videos ... MUST WATCH David Cameron talks Brexit 01:15

May, often described as "a safe pair of hands" to take the UK through its negotiations, made a speech Monday that she would follow through with the withdrawal from the EU.

CNN's Oakley said May, who had a reputation as a serious-minded workaholic, was "the nearest thing you could find in British politics today to Margaret Thatcher."

One of the longest-serving home secretaries in British history, May backed remaining in the EU, though she is known to hold Euroskeptic views and didn't take a prominent role in the campaign.

Leadsom was a strong advocate of leaving the EU, marking quite a turnaround for the politician, who three years ago said it would be a "disaster" for the UK to leave the union.

She defended that stance, saying that she had been on a "journey" since and had changed her mind.

Leadsom set out her post-Brexit vision ahead of the vote in a speech peppered with a strong sense of patriotism.

"I truly believe we can be the greatest nation on Earth," she said, promising "prosperity," not "austerity."