Theresa May’s Brexit deal has been given a lifeline after MPs supported a plan to send her back to Brussels in a bid to renegotiate the ‘Irish backstop’.

They approved the amendment tabled by Sir Graham Brady MP by 317 votes to 301, with Ms May saying afterwards that the House of Commons had spoken on how it wished to move forward.

The prime minister said there is now a “substantial and sustainable” majority in the commons for leaving the European Union with a deal but admitted renegotiation she must now undertake “will not be easy”.

She will in the coming days head to Brussels to ask for changes to the withdrawal agreement that even today, both European Commission President Jean-Claude Juncker and French leader Emmanuel Macron have ruled out.

The result in parliament came on a night when the government also defeated a string of other attempts to seize control of the Brexit process, though rebel MPs did manage to pass one amendment which saw the commons take a symbolic stance against a no-deal exit.

Ms May told the Commons after the result came in: “A fortnight ago this house clearly rejected the proposed withdrawal agreement and political declaration, with just 202 members voting in favour.

“Tonight a majority of honourable member s have said they would support a deal with changes to the backstop.

Brexit deal vote: Opposing groups of protesters gather by parliament Show all 20 1 /20 Brexit deal vote: Opposing groups of protesters gather by parliament Brexit deal vote: Opposing groups of protesters gather by parliament Brexit supporters outside parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester adjusts her pro-EU wig AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament A message to Jeremy Corbyn in support of a people’s vote Getty Brexit deal vote: Opposing groups of protesters gather by parliament A mock Titanic captained by Theresa May heads towards an iceberg in a stunt by campaigning group Avaaz AP Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters outside parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides are in close contact outside of parliament PA Brexit deal vote: Opposing groups of protesters gather by parliament Paintings of Theresa May and Jeremy Corbyn Getty Brexit deal vote: Opposing groups of protesters gather by parliament Former Ukip leader Nigel Farage speaks to the media at the protests outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament A pro-Brexit protester in Parliament Square Getty Brexit deal vote: Opposing groups of protesters gather by parliament Opposing protesters share the space outside parliament Getty Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester holds EU balloons outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters stand on Westminster Bridge PA Brexit deal vote: Opposing groups of protesters gather by parliament Former Ukip leader Nigel Farage speaks to the media at the protests outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament Anti-Brexit protesters demonstrate outside the Houses of Parliament EPA Brexit deal vote: Opposing groups of protesters gather by parliament A pro-Brexit protester sets up outside parliament Reuters Brexit deal vote: Opposing groups of protesters gather by parliament An Avaaz campaigner holds a People’s Vote life float Reuters Brexit deal vote: Opposing groups of protesters gather by parliament A demonstrator holds a sign advocating a no-deal Brexit outside parliament AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament An anti-Brexit protester waves an EU flag on Westminster Bridge PA Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides demonstrate outside parliament AFP/Getty Brexit deal vote: Opposing groups of protesters gather by parliament Protesters of opposing sides stand near parliament Reuters

“Combined with measures to address concern over parliament’s role over the negotiation of the future relationship and commitments on workers’ rights, in law where needs be – it is now clear that there is a route which can secure a substantial and sustainable majority in the house for leaving the EU with a deal.”

Earlier in the evening a plan put forward by Labour MP Yvette Cooper to prevent a no-deal Brexit in March by giving MPs the power to request an extension to Article 50 failed to receive the backing of the commons.

An amendment tabled by former Tory attorney general Dominic Grieve that would have seen MPs seize control of the Brexit process, by enabling backbenchers as well as Ms May’s executive to table legislation between now and March 29, was also defeated by the government.

In fact, the only loss Ms May suffered was on a motion that said the UK would not leave the EU without a deal, but the amendment tabled by ex-Tory minister Caroline Spelman MP was only advisory and has no legal force.

Ms May’s advisros later said that they had expected the EU to take a united line against any renegotiation in the wake of a succesful outcome to the Brady amendment.

Brexit: Caroline Spelman wins amendment: Ayes 318, Noes 310

But the string of key figures, which also included the president of the European Council Donals Tusk, underlines the Herculean task she has ahead, if she is to have any hope of making changes to the withdrawal agreement.

European Commission president Donald Tusk said the Withdrawal Agreement is “not open for re-negotiation”.

A spokesman for Mr Tusk said: “We welcome and share the UK parliament’s ambition to avoid a no-deal scenario. We continue to urge the UK government to clarify its intentions with respect to its next steps as soon as possible.