The attempt to secure a “meaningful vote” that could have potentially given MPs the power to stop Britain leaving the EU without a deal was defeated by 319 votes to 303.
Last-ditch horse trading led to the bizarre spectacle of the rebel leader, the former attorney general Dominic Grieve, voting against his own amendment.
But although the prime minister got her bill she has made significant concessions along the way, with her reluctance to confront the rebels head on undermining her authority.
Rather than face down the rebels, she kicked down the road the inevitable parliamentary clash between Tory remainers and Brexiters until crunch votes on the customs union next month.
Leading Brexiters were confident they had the numbers to defeat them and were anxious for a test of strength ahead of key votes on membership of the customs union and single market.
The bill repatriates EU law from Brussels and is a vital precondition to Britain’s exit. It is likely to get royal assent in days.
Angry opposition MPs accused Grieve of compromising his integrity as he argued that a written statement from David Davis, the Brexit secretary, underlining the role of the Speaker and parliament was enough reassurance that MPs would be able to have a voice, if not a meaningful vote, on the final deal.
They believe the government could have been defeated in an amendment that would have obliged ministers to table a motion on a final deal which MPs would be able to change.
Denis Skinner, a fervent Eurosceptic but a long-standing friend and ally of Jeremy Corbyn, helped the whips carry many waverers over the line. But Labour were clearly frustrated at the amendment was defeated.
“Tory MPs had a chance to deliver a truly meaningful vote,” a source said. “Labour MPs remained united – including some being taken through the voting lobbies in wheelchairs – but the so-called Tory rebels lost the courage of their convictions and gave licence for a no -eal Brexit.”
Keir Starmer, shadow Brexit secretary, had argued passionately in favour of the amendment that would have given MPs a formal voice in the process.
“This is a disappointing result and comes after Theresa May is forced once again to try to buy off her own MPs at the eleventh hour.”
In the end six Conservatives voted with the opposition in support of the “meaningful vote” amendment – Ken Clarke, Anna Soubry, Antoinette Sandbach, Heidi Allen, Sarah Wollaston and Phillip Lee, who resigned from the government last week in order to vote against it.
Four Labour MPs voted with the government, against the amendment. They were longstanding Brexiters Frank Field, Kate Hoey, John Mann and Graham Stringer.
Normal pairing arrangements, allowing MPs to be absent, and the power to “nod through” sick MPs were suspended for the vote. Seriously ill MPs and at least two women members who are due to give birth imminently, Jo Swinson and Laura Pidcock, had to wait for a couple of hours in the warm summer afternoon in order to vote in person.
One Labour MP, Naz Shah, was wheeled through the voting lobbies clutching a disposable sick bag. She had been in hospital for several days with severe back pain. A Labour veteran, Paul Flynn, who is seriously ill, also came in to vote.
The Grieve amendment would have ensured that MPs could amend and vote on any government motion if there was no deal on leaving the EU by 21 January next year, with only weeks to go before the formal exit day on 29 March.
It could have given MPs the power to force minsters back into negotiations rather than crashing out without a deal. Brexiters saw it as an attempt to stop Britain leaving the EU.
An unapologetic Grieve said afterwards: “We’ve managed to reach a compromise without breaking the government – and I think some people don’t realise we were getting quite close to that. I completely respect the view of my colleagues who disagree, but if we can compromise we can achieve more.”
Grieve was accused by one angry Labour backbencher of behaving like the Grand old Duke of York. “You can’t keep marching the troops up the hill and down again and keep your integrity,” George Howarth said.
Technically, MPs can still have a vote on the final deal – or no deal – but unless it is a vote of confidence, the government can ignore it.
But some MPs, such as Tom Tugendhat, who chairs the cross arty foreign affairs select committee, argue that if the government was heading for a no-deal outcome, it would be in peril automatically.
Amid a welter of procedural technicalities about the powers of MPs and the potential role of the judges, Grieve – who had said he woke up in the small hours worrying that his actions would cause the government’s collapse – withdrew his support for his own amendment.
By averting the rebellion rather than facing down the Tory rebels, their support on major issues such as membership of a customs union or the single market remains untested.
A trade bill and a customs bill will be before MPs in the coming weeks, and there are already cross-party amendments backing membership of the customs union. Government business managers will be concerned that the margin of victory in the latest vote was narrow enough for ministers to be concerned about the risk of future defeats.
In the passage of the withdrawal bill, ministers have conceded a meaningful vote on the deal if it is agreed in the autumn, and accepted a timetable of actions if the Commons votes it down.
The other significant concession was that there would be no physical infrastructure on the Irish border without parliamentary approval. That gives MPs a veto over the future trading relationship with the EU as it affects northern Ireland.
May, speaking at a summer reception hosted by the thinktank Policy Exchange, heralded Brexit as a the first step to restoring confidence in liberal democracy. “Nothing would hurt our democracy more than to give the people the choice, and then not to trust their judgement when they give it,” she said. “It is time to unite as a country and a party and to focus on getting the best deal for Britain,” she said.
Senior ministers were relieved rather than jubilant that the bill had finally cleared parliament.”I think it is a moment,” one pro-Brexit cabinet minister said. “I think it changes the political weather.”