Defeat on the amendment could have triggered a full-scale leadership crisis for the prime minister.
The government avoided what would have been an embarrassing defeat, but the razor-thin margin reveals the fragility of May's support as she tries to find a way to move the complex Brexit process forward.
MPs are due to begin their summer break next week but, as Theresa May's Brexit headache continues, a vote is expected to take place allowing politicians to start their six-week holiday early.
Their plan is simple: to kill off Theresa May's so-called Chequers plan, the Brexit compromise which has gone down badly with both Leavers and Remainers alike.
Steve Baker told the paper he resigned after discovering the "establishment elite" had secretly been pursuing a plan for a much softer Brexit than the one the Department for Exiting the European Union was working on. But Eurosceptic Conservative MPs say it's a compromise too far and Remain-supporters suggest it would be the worst of all worlds.
Tuesday was also the second day running May faced revolt from backbench Tory lawmakers, after they failed on Monday by three votes to enact changes to a crucial post-Brexit customs bill.
May has suffered a string of resignations from Cabinet members and ministerial aides over the past week.
USA threatens to sanction companies involved in Nord Stream 2 pipeline
But US economic interests only partially explain why the pipeline conflict is now emerging as a key point of contention.
'He's Evil': Author Joel Rosenberg Warns Trump Against Upcoming Meeting with Putin
Replying to that, Trump blamed former US President Barack Obama for not doing enough at the time to respond to the crisis. The White House press secretary Sarah Huckabee Sanders told NBC News on Friday afternoon that the summit is "still on".
Kylie Jenner set to become the youngest self-made billionaire on Forbes list
Jenner said she got the idea to launch her signature "lip kits" because she loved putting on lip liner as a teenager. Kylie Cosmetics' overhead costs are very low, Forbes points out, making her profit margin very, very high.
But there was no guarantee the matter of retaining a form of customs union - which pro-EU MPs see as vital to preserving industrial and commercial supply chains - would not resurface.
Junior Defence Minister Guto Bebb resigned his position after deciding to vote against the government, the 10th Conservative to quit over May's plan.
Tory Eurosceptics appear intent on a programme of rolling resignations in response to Theresa May's plan to keep the United Kingdom closely tied to the European Union after Brexit.
That, in turn, will prove the PM with a clear sense of how many MPs would be willing to vote against a final Brexit agreement this Autumn - so it's a big deal. There are several questions that remain unanswered, including the movement of aviation personnel such as pilots and maintenance technicians between the United Kingdom and EU-27, as well as how business aviation operations and services may be impacted.
The Prime Minister managed to pass amendments to the Customs Bill by just three votes - meaning the United Kingdom would leave the EU's Value-Added Tax regime.
A senior minister said it was "extraordinary that we lost the vote that didn't matter and won the one that did".
LONDON - Theresa May has narrowly defeated an effort by pro-EU MPs to keep Britain in a customs union with the European Union after Brexit.