If Boris Johnson strikes a deal with Brexit, Labor will demand that he be subject to a referendum, the party's Brexit spokesman said.
Sir Keir Starmer made the statement while UK and EU negotiators hold talks this weekend in an attempt to close a deal.
Sky News understands that Prime Minister Boris Johnson has proposed a compromise in an attempt to break the deadlock before a crucial EU summit next week.
EU optimistic when negotiations on new deals enter critical phase
A government source said "there was clearly some movement on both sides" but there was still a "way to go".
The rhetoric marks a change of tone from earlier this week when Downing Street said a deal was "essentially impossible."
Reacting to these latest developments, Sir Keir said: "If Boris Johnson can negotiate a deal, we will insist that it be returned to the people in a confirmatory vote."
Speaking at the Cooperative Party conference in Glasgow, he added that Labor is unlikely to support the kind of agreement discussed in recent days.
Sir Keir said it appears that any deal would be "even worse" than the Theresa May deal, which was rejected three times by lawmakers.
"No equitable protection. No customs union. A green light to deregulate. This kind of agreement can never be backed by Labor," he said.
Sir Keir also promised that the Labor Party would do "whatever it takes" to stop a Brexit without agreement at the end of the month.
He said that if the prime minister fails to reach an agreement at the EU summit, he must comply with the legislation passed by opposition parties that forces him to look for a delay in Britain's departure to the EU.
What is the last customs plan?
"If he can't – or I would say no – he will get a deal, we will take all necessary steps to prevent our country from falling out of the EU without a deal," Sir Keir told the conference.
"If no agreement is secured until this week, Boris Johnson must seek and accept an extension. That is the law. Not if not, but.
"And if he doesn't, we'll apply the law – in the courts and in parliament.
"Whatever it takes, we'll stop a Brexit without agreement."
PM suggests bigger concession from Brexit
He rejected suggestions that Johnson could circumvent the law by making it clear to the EU that he really did not want another extension.
The prime minister's new proposal would replace the controversial support, the insurance policy aimed at avoiding a tough Irish border, which proved to be the starting point in the negotiations.
Northern Ireland would continue to administer EU tariffs despite leaving the bloc's customs union.
This would eliminate the need for customs checks, but would also allow businesses across the border to benefit from new UK trade agreements by requesting a government discount.
EU Brexit chief negotiator Michel Barnier said the talks are intensifying "in a constructive spirit" and that Brussels "will do everything it can to reach agreement, fully in line with our principles."
Ambassadors from the remaining 27 EU countries will meet on Sunday to discuss progress in negotiations ahead of the leaders' summit on Thursday.
Parliamentarians will consider any agreement agreed with Brussels at a special session of Commons next Saturday.
A government source said "there is certainly a possibility" that there could be a vote next weekend for any new deal, but added that they are too far from that point.
Downing Street is confident that if the EU and lawmakers pass a deal next week, there will still be enough time to pass the necessary legislation to exit on 31 October.
But MPs asking for another referendum are working out plans to change any votes brought back by the government.