The House of Lords has backed calls for the UK to effectively remain in the EU's single market after Brexit.
An amendment to the EU Withdrawal Bill obliging the UK to stay in the European Economic Area after it leaves the EU in 2019 was backed by 245 votes to 218.
This was despite neither the government nor the Labour leadership backing it.
Ministers warned that staying in the EEA would not give the UK "control of our borders or our laws" and the issue will now return to the Commons.
Pro-EU MPs said they were hopeful of getting the Commons support needed to prevent the changes being overturned.
Parliament is finally taking control #Brexit & is seeing off a minority of ideologically driven hard Brexiteers. By whatever name or device there’s growing all party consensus in both Houses to ensure #UK retains benefits of #SingleMarket & #CustomsUnion after we leave #EU— Anna Soubry MP (@Anna_Soubry) May 9, 2018
But to do so they will have to defeat the two largest parties if Labour maintains its opposition to the amendment in the Commons.
Labour urged its peers to abstain in Tuesday's vote on EEA membership - an arrangement which would see the UK retain full access to the EU's internal market of 300 million consumers in return for making financial contributions and accepting most EU laws.
Under what is known as the "Norway model" - Norway is one of three countries outside the EU which is an existing EEA member - free movement laws would also apply, so EU citizens can move to all EEA countries to work and live.
Supporters of the "Norway-style" plan think keeping the maximum-possible access to the single market should be the top priority - but critics say it would mean the UK would still be subject to EU laws after Brexit, but with no say in how they are made.
Before the EEA vote, shadow foreign secretary Emily Thornberry told Labour rebels that their idea to keep the UK in the single market would "not work" and a "British bespoke deal" was needed instead.
But Labour's Lord Alli, who signed the amendment, said continued EEA membership was vital for protecting service sectors such as retail, tourism, transport, communications, financial services and aerospace.
He accused the party leadership, which supports maintaining a customs union with the EU after Brexit and hopes to replicate the benefits of the single market, of "complete cowardice" by ordering peers to abstain.
"The customs union only will benefit our European neighbours in their imports," he said.
"Without an EEA equivalent it will damage our profitable export business and therefore the jobs and livelihoods of many thousands of people."
More than 80 Labour peers defied the party whip by voting for the amendment, while among those Conservative rebels backing the amendment were former party chairman Lord Patten and former deputy prime minister Lord Heseltine.
But Brexit minister Lord Callanan said it would not satisfy the British public's desire, as expressed in the Brexit referendum, for more "direct control" over how the country is run.
"On borders it would mean that we would have to continue to accept all four freedoms of the single market, including freedom of movement," he said.
"On laws it would mean the UK having to implement new EU legislation over which in future we will have little influence and, of course, we will have no vote."
The government's Brexit bill also suffered a series of other defeats at the hands of peers.
The Lords voted to remove the exact date of Brexit - 29 March 2019 - from the wording of the EU Withdrawal Bill by 311 votes to 233. And an amendment which means the UK could continue to participate in EU agencies after Brexit was backed by 298 votes to 227.
The government is expected to seek to reverse a number of the Lords amendments when the bill returns to the Commons.