Ed Miliband would have deprived David Cameron of a majority – and saved Ed Balls his seat – if he had promised an in/out referendum on the European Union, a leaked private poll has revealed.

A survey of more than 4,000 voters carried out on the day of the general election found one in six Tory and Liberal Democrat voters – and a third of Ukip supporters – would have considered voting Labour if Mr Miliband had promised to hold a referendum.

The switch could have cost the Tories eight seats, leaving Mr Cameron with 323 MPs – three short of an outright victory.

The ComRes poll was commissioned by the millionaire Labour donor John Mills. The Eurosceptic businessman told The Independent on Sunday the poll suggested Mr Balls – who urged the party to take a more Eurosceptic stance – would have kept his seat.

He said: “It was a huge missed opportunity by Labour to allow this to happen. The party’s position towards the EU has been one of unqualified support for years.