Theresa May hopes to bring her Brexit deal back to parliament again next week after it was rejected for a third time by MPs – and appears poised to trigger a general election if parliament fails to agree a way forward.

Brexit: MPs defeat May's withdrawal agreement for third time by 344 to 286 votes - live news Read more

Despite the embattled prime minister’s dramatic promise on Wednesday that she would hand over the keys to 10 Downing Street if her Tory colleagues backed the withdrawal agreement, parliament voted against it on Friday, by 344 to 286.

The Commons vote was held on the day when Britain was meant to be leaving the European Union, as Parliament Square outside overflowed with raucous pro-Brexit protesters.

A string of leave-supporting Conservative backbenchers who had twice rejected the deal, including Boris Johnson, Jacob Rees-Mogg and former Brexit secretary Dominic Raab, switched sides to support the agreement. But with Labour unwilling to shift its position, and the Democratic Unionist party’s 10 MPs implacably opposed, it was not enough to secure a majority for May.

The result was a sense of stunned disbelief in Westminster. Asked what could happen next, one government source said: “Last one out, turn off the lights.”

Immediately after the defeat was announced, May told MPs: “The implications of the house’s decision are grave. The legal default now is that the United Kingdom is due to leave the European Union on 12 April. In just 14 days’ time.”

Under the deal agreed by EU leaders in Brussels last week, if May had passed her withdrawal agreement this week, Brexit would have been delayed until 22 May. Now, she will have to return to Brussels for an emergency European council summit on 10 April.

The EU27 expect her to ask for a longer delay – requiring Britain to participate in the European elections in May – or accept a no-deal Brexit two days later. However, her aides hope the 22 May date could still be in play if her deal is accepted next week.

May did not spell out explicitly what she planned to do next, saying only that she would press ahead with an “orderly Brexit”. However, it became increasingly clear after the vote that Downing Street does not believe the deal is dead.

The prime minister pointed to MPs’ plans to hold a second round of indicative votes on Monday, “to see if there is a stable majority for a particular alternative version of our future relationship with the EU”.

But she told MPs: “I fear we are reaching the limits of this process in this house.” Many regarded that as a warning that if they supported an option she was not prepared to implement, or failed to reach agreement on an alternative, she was ready to call a general election.

Government sources suggested she was first likely to make another attempt to force her deal through parliament in a third “meaningful vote”. This might happen in a “run-off” against any successful alternative from Monday’s indicative votes.

The government has been discussing with the Speaker, John Bercow, whether there is a way to hold MV3 that would not fall foul of his insistence that the same proposition cannot be put before parliament again.

A Downing Street spokesman highlighted the fact that May’s margin of defeat, 58, was smaller than the 149 majority she lost by earlier this month, and the crushing 230-strong defeat in the first meaningful vote in January. “We are at least going in the right direction,” the spokesman said.

No 10 sources also pointed out that her deal had won more supporters than any of the eight options considered by MPs in Wednesday’s indicative votes, in which the most popular, a referendum, received the backing of 268 MPs.

Backers of the various alternatives were discussing how to build a proposition that could command a majority on Monday. Cabinet ministers were instructed to abstain in last week’s process, which the government had initially tried to scupper by whipping MPs to vote against the business motion.

May is likely to come under pressure to offer a free vote to cabinet supporters of a soft Brexit – the “Gaukward squad” – on Monday.

Jeremy Corbyn responded to the prime minister’s latest defeat by calling on her to resign and trigger a general election.“If the prime minister can’t accept that, then she must go, not at an indeterminate date in the future, but now, so that we can decide the future of this country through a general election,” the Labour leader said.

He had earlier urged his MPs to reject the deal, warning that it would lead to a “blindfold Brexit”. Just five Labour MPs voted for the withdrawal agreement.

Before the vote, May had told MPs that the withdrawal agreement was the only way to guarantee Brexit and avoid a “cliff edge” in two weeks’ time. “When the division bell rings in a few moments, every one of us will have to look into our hearts to decide what is right for our country,” she said.

Friday’s vote did not technically qualify as a third “meaningful vote”, because MPs were asked to consider only the withdrawal agreement, which includes the controversial Irish backstop and secures EU citizens’ rights and the post-Brexit transition period.