Theresa May has seen off an attempt tonight by rebel backbenchers to oust her as Conservative leader and Prime Minister.

But she sowed the seeds for her eventual departure by telling Tory MPs that she would not lead the party into the next general election, expected in 2022 The Prime Minister won a confidence vote of the 317 Conservative MPs by a margin of 200 to 117 in a secret ballot at Westminster.

The vote was triggered by party grandee Sir Graham Brady, the chair of the backbench 1922 Committee, early on Wednesday after he received letters of no confidence in the PM from at least 15% of the parliamentary party.

Mrs May had vowed to fight “with everything I’ve got” to retain her place as Tory leader as she faced an attempt to oust her through a confidence vote.

Mrs May looked set to see off the challenge to her leadership, as scores of Tory MPs made public statements of support.

And she received an enthusiastic welcome as she addressed Conservative MPs at the backbench 1922 Committee moments before the crucial vote began at 6pm, with backers banging their desks to show their support.

The result of the confidence vote was announced at 9pm tonight.

Other MPs indicated that Mrs May had promised to find a “legally binding solution” to ensuring that the UK does not get permanently trapped in a backstop arrangement to keep the Irish border open after Brexit.

Anger over the backstop among Tory backbenchers and their Democratic Unionist Party allies was the main obstacle to Mrs May getting her Brexit deal through the House of Commons earlier this week.

Her decision to defer the vote sparked a new wave of letters of no confidence which pushed the total beyond the threshold of 48 needed to trigger a ballot.

Failure to reach this figure would have triggered a leadership contest in which she could not stand. But if she wins, another challenge cannot be mounted against her position as Tory leader for a year.

Mrs May insisted she would stay on to "finish the job" she has set herself as Prime Minister of addressing priorities like the economy, public services and housing as well as delivering on the result of the 2016 referendum.

But questions were raised over whether she was privately assuring colleagues she would step down once the Brexit process was over, after a senior Downing Street source told reporters that tonight's vote was not about choosing a leader to take the party into the next election.

"This vote isn't about who leads the party into the next election, it is about whether it makes sense to change leader at this point in the Brexit negotiation," said the source.

He insisted he was "not aware" of Mrs May floating a departure date in conversations with Cabinet ministers and backbench MPs, and declined to discuss whether she would stay on if she won the ballot by a slender margin.

"She has said on a number of occasions - in fact she said immediately after the last election in 2017 - that she would serve as long as her colleagues want her to," he said.

"She believes it is her duty to serve as long as the party wants her to."

Mrs May was buoyed by cheers from her own backbenches in a raucous House of Commons as she stood up for what could be her final session of Prime Minister's Questions.

Husband Philip showed his support by watching from the public gallery, while Tory elder statesman Kenneth Clarke told MPs that a leadership contest within months of the March 29 date of Brexit would be "irresponsible and unhelpful".

None of the PM's Brexit-backing critics took the opportunity to attack her, while there were strong words of support from backbenchers including Neil O'Brien (Harborough), who condemned "headbangers from all sides" for undermining her.

Mrs May resisted calls from Labour and the Scottish National Party to bring her Brexit deal immediately back before the Commons, after she pulled the "meaningful vote" expected on Tuesday. And she insisted a general election would not be "in the national interest".

Labour leader Jeremy Corbyn denounced her actions as "totally and absolutely unacceptable", while the SNP's leader in Westminster Ian Blackford called on her to resign.