The House of Lords voted 348 to 225 to amend the government’s EU Withdrawal Bill, which will now return to the House of Commons where the defeat is likely to spur renewed opposition.
The amendment requires the government to report to Parliament by October 31 on what steps it has taken to remain in the customs union, which allows goods to flow freely across the European Union.
The government opposed the amendment. Prime Minister May had previously said Britain will not remain in the customs union after Brexit takes effect.
The House of Lords is now considering other amendments to the proposed legislation.
The customs union enables the 28 EU member states, and other countries such as Turkey that have signed up to its rules, to function as a single trading area.
In practice, it means that cars made in France can be sent to Italy without facing tariffs or a customs check at the border. Goods made outside the union are allowed to circulate freely once they’ve gained initial entry.
However, membership prevents a country from negotiating its own bilateral trade deals with other nations.
The ability to agree new trade deals — with the United States or China, for example — is central to Prime Minister Theresa May’s vision for Britain after Brexit. In a speech in September, she ruled out staying in the customs union.