British Energy Minister Andrea Leadsom has pulled out of the leadership race for the Conservative Party, leaving her rival Theresa May as the only candidate.

Just hours later, Prime Minister David Cameron announced he would resign by Wednesday.

Leadsom and May had been due to contest a ballot of around 150,000 members to become head of their party - a position which would automatically make one of them Britain's next prime minister.

The result was to be declared by early September, but Monday's shock announcement opened the way for May to take over much sooner.

Speaking to reporters, Leadsom announced that she was pulling out of the race, claiming she did not have enough support to spare the Conservatives a protracted leadership battle with May, who has the majority of support from within the party.

"There is no greater privilege than to lead the Conservative Party in government, and I would have been deeply honoured to do it," Leadsom said, reading from a statement.

"I have, however, concluded that the interests of our country are best served by the immediate appointment of a strong and well-supported prime minister. I am therefore withdrawing from the leadership election and I wish Theresa May the very greatest success. I assure her of my full support," she said.

Graham Brady, the head of the committee running the contest, said after Leadsom's announcement that the party board would meet to discuss confirming May as the winner. He did not suggest reopening the race and did not say when the party might confirm that she has won.

Interview backlash

Leadsom's announcement followed controversial comments she made about May.

In an interview with The Times, which was published on Saturday, Leadsom said she was a more suitable candidate for party leader and successor to David Cameron as British prime minister because she was a mother - unlike May, the home secretary, who is childless.

Her comments, which she initially denied, provoked widespread criticism including from inside her own party, Al Jazeera's Laurence Lee, reporting from London, said.

Leadsom later apologised, saying she did not intend to cause offence.