LONDON (AP) — British Prime Minister Theresa May survived a brush with political mortality Wednesday, winning a no-confidence vote by Conservative lawmakers that would have ended her leadership of party and country.
May won the vote of 317 Conservative legislators with a 200-117 tally that reflected the discontent within the party over her handling of Britain's exit from the European Union.
Despite the victory, Brexit remains her government's biggest problem. May is heading to Brussels to seek changed to her divorce deal from the European Union in order to make it more palatable to Parliament.
The balloting came after May's Conservative opponents, who circled the weakened prime minister for weeks hoping to spark a no-confidence vote, finally got the numbers they needed to call one.
The result was announced to loud cheers from lawmakers gathered in the wood-paneled room where they had voted. Under party rules, May cannot be challenged again for a year.
May had earlier vowed to fight for the leadership of her party and the country "with everything I've got," and spent the day holed up in the House of Commons trying to win over enough lawmakers to secure victory.
"A change of leadership in the Conservative Party now will put our country's future at risk," May said in a defiant statement outside 10 Downing St.
She said that ousting her and a vote on her replacement — a process that could take weeks — could result in Brexit being delayed or even halted. May, who spent Tuesday touring European Union capitals to appeal for changes to sweeten her divorce deal for reluctant U.K. lawmakers, has until Jan. 21 to hold a vote on the agreement in Parliament, a timetable that could be scuttled if she is replaced.
In a bid to win over wavering lawmakers, May indicated she would step down before the next election, due in 2022.
Solicitor-General Robert Buckland said May told lawmakers at a meeting that "it is not her intention to lead the party in the 2022 general election."
Another Tory legislator, Nick Boles, tweeted: "She was unambiguous. She will not be leading the Conservative Party into the next election."
May has not said what she will do if, as many expect, there is an early election triggered by Britain's Brexit crisis.
The leadership challenge marked a violent eruption of the Conservative Party's decades-long divide over Europe and throws Britain's already rocky path out of the EU, which it is due to leave on March 29, into further chaos. It comes days after May postponed a vote to approve the divorce deal to avoid all-but-certain defeat.
The threat to May has been building as pro-Brexit Conservative lawmakers grew increasingly frustrated with the prime minister's handling of Brexit.
Many supporters of Brexit say May's deal, a compromise that retains close economic ties with the EU, fails to deliver on the clean break with the bloc that they want.
Former Environment Secretary Owen Paterson accused May of acting like a "supplicant" in dealings with the EU.
"She's not the person to see Brexit through," he said.
Opposition lawmakers expressed astonishment and outrage at the Conservative civil war erupting in the middle of the fraught Brexit process.
"This government is a farce, the Tory party is in chaos, the prime minister is a disgrace," Scottish National Party leader Ian Blackford said during a pugnacious Prime Minister's Questions session in the House of Commons.
British business figures had expressed alarm at the prospect of even more political uncertainty.
"At one of the most pivotal moments for the U.K. economy in decades, it is unacceptable that Westminster politicians have chosen to focus on themselves, rather than on the needs of the country," said Adam Marshall, director general of the British Chambers of Commerce.
Graham Brady, who heads a committee overseeing Conservative leadership contests, announced early Wednesday that he had received letters from at least 48 lawmakers asking for a vote. That's the 15 percent of Conservative legislators needed to spark a leadership challenge under party rules.
May canceled a Wednesday trip to Dublin to meet Irish Prime Minister Leo Varadkar so she could stay in London and battle for lawmakers' support.
But before it, Cabinet colleagues rallied to May's support. Home Secretary Sajid Javid tweeted that a leadership contest, with Brexit little more than three months away, "will be seen as self-indulgent and wrong."
Justice Secretary David Gauke said: "I think it's vital for the country that she wins tonight."
He said that if May lost, "I don't think we will be leaving the European Union on the 29th of March."
EU leaders tried to stay out of the fray. There was no change in plans for May to address them about Brexit at a summit on Brussels on Thursday.
The European Parliament's Brexit point man, Guy Verhofstadt, could not contain a note of annoyance, tweeting: "Once again, the fate of EU-U.K. relations, the prosperity of businesses & citizens' rights are consumed by an internal Conservative party catfight over Europe."
Associated Press writers Danica Kirka and Gregory Katz in London contributed.