LONDON (Reuters) - British Prime Minister Theresa May narrowly avoided a defeat in parliament at the hands of pro-EU lawmakers from her own party on Tuesday, fending off a rebellion that threatened to worsen a crisis over her Brexit strategy.

Parliament voted 307 to 301 against an amendment to trade legislation that would have required the government to try to negotiate a customs union arrangement with the EU if, by Jan. 21, 2019, it had failed to negotiate a deal with the bloc that offered frictionless free trade for goods.

The narrow victory is May’s third this week, underlining the difficulty she faces in passing legislation on one of the most divisive and important decisions in modern British history with only a minority government and a party at war with itself.