Plans to put an UK referendum on EU membership into law have been dashed after the House of Lords voted to block the bill by 180 votes to 130.

A bill by Conservative MP James Wharton had proposed to guarantee a public vote on the UK's EU membership in 2017.

Student or retired? Then this plan is for you.

Prime Minister David Cameron has promised to re-negotiate the UK's membership terms if his party, which currently dominates a governing coalition with the pro-European Liberal Democrats, wins the next election in 2015.

However, peers voted on Friday (31 January) to end the committee stage of the legislation, meaning that, with just a week before the end of the current parliamentary session, it has run out of time to get through.

The Lords had already backed amendments to change the proposed question of the referendum and to force the government to prepare an assessment of what the UK's relationship with the rest of the EU would look like if it withdrew from the bloc prior to the referendum.

Although the legislation was not an official government bill it was approved by MPs in the House of Commons, where the Conservative party is just a handful of seats short of an overall majority. However, Labour and Liberal Democrat peers, whose parties oppose a referendum, were able to form a blocking majority in the Lords.

"Labour and the Lib Dems have conspired in the House of Lords to kill this important piece of legislation, doing the bidding of their political masters in the Commons," said Wharton in a statement following the vote.

However, Prime Minister David Cameron insisted that the collapse of the bill would not bring an end to the referendum debate.

Speaking at a joint press conference following talks on defence co-operation with French President Francois Hollande, Cameron said that the vote made "no difference to the pledge I am making on this in-out referendum."

"As Labour and the Lib Dems have killed the Wharton Bill, the one way to guarantee a referendum is to vote Conservative at the Gen Election," he wrote in a message on Twitter.

Meanwhile, there is still a possibility that the Conservatives could attempt to re-introduce the bill in the autumn, although it would be likely to face further delaying tactics.