London (CNN)The UK Government has lost a key Brexit vote, with the upper House of Parliament backing calls to remain in the EU customs union after Brexit.
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.
What is the customs union?
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.
The government said it regretted the defeat. "The fundamental purpose of this bill is to prepare our statute book for exit day, it is not about the terms of our exit," a spokeswoman for the Department for Exiting the European Union said in a statement.
"This amendment does not commit the UK to remaining in a customs union with the EU, it requires us to make a statement in parliament explaining the steps we've taken.
"Our policy on this subject is very clear. We are leaving the customs union and will establish a new and ambitious customs arrangement with the EU while forging new trade relationships with our partners around the world."
However, Andrew Adonis, who sits in the House of Lords on the opposition Labout benches, said: "At long last, a voice of common sense on Brexit has made itself heard in parliament. It is simply impossible to do Brexit without a customs union so the House of Lords has spoken up for good and responsible government.
"However, even with a customs union Britain will still be worse off if we leave. That is why we need a people's vote on the final deal."