Labour delegates have approved a motion that would keep all options - including a fresh referendum - on the table if MPs are deadlocked over Brexit.
It was passed by a show of hands at the party conference in Liverpool.
The vast majority were in favour of the motion, with only a small number against.
Leader Jeremy Corbyn - who has previously ruled out another EU referendum - has said he will respect the result of the vote.
Sir Keir Starmer said earlier that the option of staying in the EU would be on the ballot paper in any future referendum if Labour gets its way.
In his party conference speech, the shadow Brexit secretary said all options should be kept on the table, including a so-called People's Vote, to "stop a destructive Tory Brexit".
But a senior Unite official said another vote would "reopen the wounds of Brexit" not heal them.
Labour's policy had been to force an election if MPs are deadlocked over Brexit but members succeeded in getting a debate on getting a fresh referendum on to the agenda at the conference.
Sir Keir told Labour activists if a general election was not possible "then other options must be kept open".
"That includes campaigning for a public vote," he said.
"It is right for Parliament to have the first say but if we need to break the impasse, our options must include campaigning for a public vote and nobody is ruling out Remain as an option."
Monday saw confusion over whether the leadership thought any fresh referendum should include staying in the EU as an option.
Shadow chancellor John McDonnell said he thought any vote should be on the terms of a Brexit deal - rather than on remaining in the EU.
But he later said "all options" were on the table - a point reinforced by Sir Keir.
Labour - which wants the UK to remain in a customs union but not the single market - has not ruled out voting for any deal Mrs May brings back from Brussels, ahead of the UK's 29 March departure date.
But Sir Keir said the six tests his party has set - including guarantees on workers' rights and retaining the economic benefits of existing market arrangements - were unlikely to be met.
"Some have said Labour could vote for any deal the Tories reach. Some have said we may abstain. Some have said we may vote for a vague deal," he said.
"So, let me be very clear - right here, right now: if Theresa May brings back a deal that does not meet our tests - and that looks increasingly likely - Labour will vote against it. No ifs, no buts.
"And if the prime minister thinks we'll wave through a vague deal asking us to leap blindfolded into the unknown, she can think again."
But Unite assistant general secretary Steve Turner said any vote on the outcome of the Brexit negotiations could not be a re-run of the 2016 in-out referendum.
"Despite what Keir said earlier, it's a public vote on the terms of our departure," he said.
"We desperately need a better, fairer society - we need to heal the wounds of Brexit, not reopen them, and only our movement, united with a proud socialist government, is capable of doing that."
The Labour Leave campaign group, which backed Brexit in the 2016 referendum, said Sir Keir was "playing with fire" and talk of a referendum made Labour look like "the party of Remain".
"We're damaging the Labour brand and alienating our supporters," said its general secretary Brendan Chilton.
"We have already had a vote on the UK's membership of the EU; it's been done and dusted. The Labour Party and its members must accept this and move on."
The prime minister's Chequers plan, which would see the UK staying closely aligned to the EU in some areas, such as the trade in goods, has been criticised by EU leaders and many of her own MPs.
The Conservatives accused Labour of "playing political games".
"Labour seem determined to take us all back to square one by rejecting a deal out of hand then trying to delay Brexit and re-run the referendum," said Brexit minister Robin Walker.