Prime Minister David Cameron's attempt to make a referendum on Britain's European Union membership legally-binding passed its first hurdle when his Conservative Party won a vote on the issue in parliament.

British politicians supported a bill that legislates for an EU referendum by the end of 2017 by 304 votes to zero.

The bill is seen as a way to convince eurosceptic Britons before a 2015 election that Mr Cameron will give them an in/out EU vote.

The draft law could yet be defeated as it makes its way through parliament.

It will not bind the hands of the next British government after the 2015 election, even if it does become law and is therefore largely symbolic.

Mr Cameron's pro-EU coalition partners, the Liberal Democrats, abstained after dismissing the vote as a parliamentary stunt.

Most Labour politicians also boycotted the vote, describing it as the Conservatives "talking to themselves".

Mr Cameron wants Britain to stay inside a reformed EU, said in January that he would hold a referendum in the first half of the next parliament, providing he is re-elected.

In May, 115 of his MPs backed an amendment to the Queen's Speech, which sets out the government’s planned laws, criticising the failure to include a referendum bill.

The inclusion was blocked from being part of the government's legislative programme by the Liberal Democrats.

In an effort to foster more harmony in the ranks, Mr Cameron hosted a barbecue for Conservative MPs in the garden of 10 Downing Street to help nurture relations with a restive parliamentary party.

Labour leader Ed Miliband came under renewed pressure to commit Labour to a public vote when one of his MPs broke ranks to call for a vote to be held even sooner than under Mr Cameron's plans.

Dudley North MP Ian Austin, a former aide to Gordon Brown, wrote in the Express and Star newspaper: "The truth is that the UK needs to decide and I would prefer it to do so more quickly.

"I know this isn't Labour Party policy, but my view is that we should have a referendum next year on the same day as the European elections."