UK Prime Minister Theresa May has announced her resignation as prime minister and Conservative Party leader.

May's attempt to bring forward the legislation to enact Brexit had triggered a collapse in support for her among Conservative members of Parliament.

Senior members of May's Cabinet told her that her plans no longer had their support.

She says she'll stand down as leader on June 7 but remain as prime minister until the Conservative Party elects her successor.

The Labour leader Jeremy Corbyn has called for an immediate general election.

Visit Business Insider's home page for more stories.

LONDON — Theresa May has announced her resignation as UK prime minister and Conservative party leader.

In an emotional statement on Downing Street alongside her staff and her husband, Philip, the prime minister said she would step down as party leader on June 7 but remain as prime minister until a successor could be chosen by the party.

May said she had decided to step down to give a successor a chance to implement Brexit, having failed three times to pass her deal with the European Union through Parliament.

"I have done everything I can to convince MPs to back that deal," she said on Friday morning.

"I believe it was right to persevere even when the odds against success seemed high. It is now clear to me it is in the best interests of the country for a new prime minister to lead that effort."

She added: "I will resign as leader of the Conservative and Unionist Party on Friday, June 7."

Read more: What happens now Theresa May has resigned?

May's announcement followed a meeting on Friday morning with Graham Brady, the chair of the 1922 Committee of Conservative MPs.

The committee's executives met Wednesday to vote on whether to change Conservative Party rules to allow a vote of no confidence in May, with the result sealed in an envelope until she confirmed whether she would resign.

The announcement also comes ahead of the results of the European Parliament elections, in which May's Conservative Party is predicted to come as low as fifth place.

The Labour leader Jeremy Corbyn said that May was "right" to resign and that her government had "utterly failed the country over Brexit and is unable to improve people's lives or deal with their most pressing needs."

He called for an immediate general election, saying, "Whoever becomes the new Conservative leader must let the people decide our country's future."

"The prime minister is right to recognize that her administration has reached the end of the road," said the Liberal Democrats leader Vince Cable. "Sadly her compromises through the last three years have too often been with the right wing of her own party, rather than about bringing the country together."

Watch May's emotional resignation statement

The prime minister had hoped to stay in the job long enough to pass her Withdrawal Agreement Bill, which would have allowed the UK to leave the EU by this summer.

She was forced to abandon her attempt, however, after senior members of her Cabinet made it clear they could no longer support her Brexit plans.

A speech by May earlier this week, in which she committed to allowing members of Parliament a vote on calling a second referendum on Brexit, triggered a collapse in support for the prime minister among formerly loyal allies.

Andrea Leadsom resigned Wednesday as leader of the House of Commons in protest over the contents of the bill. On Thursday, May was forced to shelve the bill.

The foreign secretary, Jeremy Hunt, told May on Thursday not to attempt to bring her bill before the House of Commons, with the home secretary, Sajid Javid, telling her to remove the provision for a referendum vote.

What happens now that May has announced her resignation?

Boris Johnson. Getty

The Conservative Party has yet to decide the timetable for replacing May.

Party authorities are keen to speed up the process to ensure that a new prime minister can be in place before the end of the UK's latest Brexit extension, due to finish at the end of October.

Under party rules, Conservative MPs must select two candidates to be put to a vote of the wider membership.

Recent YouGov polling of members suggests that the former Foreign Secretary Boris Johnson is the runaway favorite to succeed May should he make the final two.

He is also gaining ground in winning over Conservative MPs, despite his divisive reputation among many moderates in the party.

There will most likely be a large field of candidates for the job, meaning that Johnson is by no means assured of making the final round.

In 2016 he was forced to drop out of the race to succeed Prime Minister David Cameron after concluding he didn't have sufficient support among Conservative MPs.

Other candidates expected to formally enter the race include Javid, Leadsom, Hunt, and Environment Secretary Michael Gove.