The Welsh Assembly has rejected Theresa May's Brexit agreement in a symbolic vote in the Senedd.
Finance Secretary Mark Drakeford said the deal fails to meet the "fundamental interests" of Wales and the UK.
Labour AMs backed a Plaid Cymru proposal to oppose the deal after a row over the Welsh Government's stance. 34 AMs backed the text, with 16 against.
The Tories accused Plaid and Labour of trying to undermine the original EU referendum result.
AMs discussed the proposed withdrawal agreement in a two-hour long debate in the Senedd on Tuesday.
But the Labour-led Welsh Government was criticised for tabling a motion for a vote that did not give a clear view against the deal.
Following the debate, Labour AMs abandoned most of their own government's wording and supported instead a Plaid Cymru amendment that was more strongly opposed.
The vote, which calls for the UK to stay in the EU's single market and customs union, stands as the official view of the assembly but is not binding on the UK government.
It comes on the same day the prime minister suffered three Brexit defeats in the House of Commons.
By James Williams, BBC Wales Brexit correspondent
The Welsh Conservatives had called the Brexit debate a "pantomime".
By the end of play, the discussions would perhaps be better described as a bit of a farce for the Welsh Government.
First Minister Carwyn Jones had said for months that it was important for the assembly to send a clear statement of its position on Theresa May's Brexit deal ahead of the "meaningful vote" in the House of Commons.
So, it came as a bit of a surprise when the Welsh Government's motion for the debate, whilst critical of the deal, did not explicitly reject the UK-EU agreement.
On top of that, the motion said there would be another opportunity to debate the deal when considering giving legislative consent to the UK government's forthcoming Withdrawal Agreement Bill. But the assembly's legislative consent may not be needed.
The Welsh Government motion was clearer, I'm told by a source, when first drafted. Then it become less clear after a special Welsh Government cabinet discussion, and then less clear again after the Welsh Labour group got its hands on it.
One Labour AM described the final motion as "bizarre" and "inelegant". Another party source called it "clunky" before a third said: "That's what you get when you decide things by committee."
Labour minister Mark Drakeford told the debate that Wales would be "better off remaining in the European Union".
He said: "I hope this national assembly will send a clear message this afternoon that the deal which has been negotiated by the prime minister is unacceptable."
Conservative and UKIP AMs opposed Plaid Cymru's amendment.
Senedd Tory Leader Paul Davies argued AMs should back the agreement because "the clock is ticking, and this is the only deal on the table".
Mr Davies said: "The irony is that Brexit has a greater legitimacy and a bigger mandate from the public than this Welsh Government, which seems to me is trying to overturn it."
"The Brexit referendum was undoubtedly divisive. If this division and uncertainty goes on unchecked it threatens our economy and public services," he added.
Leave supporter and UKIP AM Neil Hamilton made a pro-Brexit case against the deal, saying the agreement does not respect the 2016 EU referendum result.
Mr Hamilton said: "In fact it is, in political terms, a national humiliation. A capitulation, which has given the EU everything and actually given the UK nothing."
UKIP's pro-Brexit anti-deal motion only won five votes, with 44 opposed.
The withdraw agreement includes a short "political declaration" on the future relationship with the EU.
Plaid's Brexit spokesperson in the Welsh Assembly, Steffan Lewis, said both should be opposed.
"My conscience tells me that the deal on offer is so potentially damaging to the communities we're elected to represent that neither the withdrawal agreement or the political declaration deserve the support of this Parliament," he said.
His party leader Adam Price said: "We are glad that Labour answered our call to work together at a cross-party level by accepting our important amendment, which means that the Senedd has tonight spoken with a clear voice to say that we do not support the prime minister's Brexit deal."
The motion passed on Tuesday called for a general election or a further referendum if the UK government cannot get its deal through the House of Commons.
A Plaid motion that more clearly called for a referendum failed to pass, despite support from Lib Dem AM Kirsty Williams, and Labour AMs Lynne Neagle and Joyce Watson.