Labour will whip its MPs to back a second referendum on Boris Johnson’s Brexit deal during the passage of ratification legislation through parliament, shadow cabinet minister Sir Keir Starmer has said.

But the shadow Brexit secretary said any amendment was likely to be tabled by backbench MPs rather than the Labour leadership, in order to try to enable the broadest possible cross-party coalition in the House of Commons.

Starmer indicated that Labour could vote for the prime minister’s deal with a referendum attached in order to force a Final Say vote.

“Of course we need an amendment to say that whatever deal gets through, it should be subject to a referendum where that deal is put to the public and they’re asked ‘do you want to leave on these terms, or would you rather remain in the EU’,” Starmer told BBC!’s Andrew Marr Show.

Asked whether Labour MPs will be whipped on a referendum vote, Sir Keir said: “We’ve already voted, I think, three times as a party for a second referendum with a three-line whip behind it.

“That’s the clear policy, whether it’s this deal or any future deal it’s got to go back so the public can say."

Challenged over whether Labour would back Mr Johnson’s deal if it had a public vote attached, Sir Keir said: “We will see what that looks like, but it makes sense to say by whatever means we get that referendum. The spirit of this is very, very clear and we actually offered this to Theresa May. We said that we don’t think your deal is very good, but if it’s up against the safeguard of being able to remain, then we will allow it to proceed in that way.”

He also acknowledged that a referendum would require “detailed legislation” and that it would probably take up to 22 weeks to arrange.

But he said: “This is such a fundamental question that we have to press this point about the referendum. The position we’ve adopted is that whatever the outcome – whether it’s Boris Johnson’s bad deal or a better one which could be secured, it’s got to go to a referendum up against Remain.”

Foreign secretary Dominic Raab said Labour's position was "extraordinary".

He told Marr: "The Labour Party stood on a manifesto - just as we did - to give effect to the referendum in 2016. They are now clearly planning to reverse that and that's a breach of faith with the voters. Many of your viewers at home will be astonished. We've actually secured a deal with the EU. A lot of people said the Prime Minister couldn't do that. He's got that deal. We seem to have the numbers in the House of Commons.