Mr McDonnell told the BBC’s political editor: “We want a deal that will protect jobs and the economy.

“If we can’t achieve that – the government can’t achieve that – we should have a general election, but that’s very difficult to do because of the nature of the legislation that David Cameron brought forward.

“If that’s not possible, we’ll be calling upon the government then to join us in a public vote. It’s difficult to judge each stage, but that’s the sequence I think that we’ll inevitably go through over this period.”

Asked by Laura Kuenssberg if a vote of no confidence did not bring down the government a second referendum was “inevitable”, Mr McDonnell replied: “That’s right.

“Our policy is if we can’t get a general election, then the other option which we’ve kept on the table is a people’s vote.”