British Prime Minister Theresa May narrowly avoided a defeat in parliament on Tuesday, after MPs voted 307 to 301 against an amendment to trade legislation put forward by pro-EU Conservative lawmakers.
The MPs wanted the UK to try to negotiate a customs union arrangement with the EU if it was not able to reach a frictionless free trade deal with the bloc.
May was reportedly faced with the threat of a no confidence vote if she lost.
However, while narrowly winning on the customs union, the government was earlier defeated on a separate amendment, which means it will now be required to seek continued participation in the European medicines regulatory framework.
"Very significant defeat of govt tonight on European medicines regulation amendment. Near miss on customs union amendment. Margin is closing on these votes & we will keep at it," tweeted Keir Starmer, Brexit spokesman for the opposition Labour Party.
May will be back in the firing line on Wednesday when she takes questions from MPs before appearing in front of a parliamentary committee, and then leading a Conservative Party meeting.