By Ian Dunt
MPs overwhelmingly voted against amendments to the European Union bill this evening, after a lengthy debate in the Commons.
Veteran eurosceptic Bill Cash led the debate by putting forward a series of radical changes designed to defend the sovereignty of parliament for the EU and the courts.
His amendment was defeated by 39 to 314.
Tory backbencher Douglas Carswell branded the bill, which would ensure a referendum in the case of a "significant" EU treaty, "smoke and mirrors".
"This bogus EU bill is no substitute for the referendum we were promised. Nothing in this bill will cause the permanent British representatives in Brussels, who really decide Europe policy, to change course," he wrote on his blog.
Mr Cameron originally promised the referendum lock in opposition, when it became clear that his promise of a referendum on the Lisbon treaty would not be possible.
But Tory backbenchers have been dismayed by the moderate tone adopted towards the EU from the prime minister and his foreign secretary, William Hague, since they arrived in office.
Combined with the unconcealed pro-European credentials of the Conservatives' Lib Dem coalition partners, many eurosceptic backbenchers have become uncomfortable with the way Britain's relationship with the EU is being managed.
The bill allows for ministers to decide when a treaty is "significant" enough to warrant a referendum, although that decision would be subject to judicial review.
That measure has been subject to criticism for various reasons. Some critics say that ministers will go out their way to deny that a treaty is significant, while others, including Ed Miliband, argue that the judiciary should not be making decisions meant for parliament.
Europe minister David Lidington tried to placate Troy backbenchers this morning.
"We are saying any future change to EU treaties, however minor, will be subject to a full act of parliament," he told the Today programme.
"Any extension of EU competencies, [such as] a decision like joining the euro, would have by law to go with a referendum. There would be no wriggle-room for the government.
"And we have two clauses which make it clear that parliament has the final say in deciding whether EU law has effect in the UK.
"The wriggle-room for ministers is narrowed down to the smallest margin possible."
Writing in the Sunday Telegraph, Mr Hague insisted the bill would protect Britain from any further expansion of EU jurisdiction.
"The truth is that only in a few minor areas does it give the ministers of the day any discretion at all about the calling of a referendum - and then only if they can persuade parliament and the courts that they are right," he wrote.
"When it becomes an act this will be the strongest defence of national democracy put in place anywhere in Europe. It is a massive advance for national democracy."
But Labour was unimpressed by the law, especially the judicial review aspect, which they said hands power to judges which should be in the hands of elected representatives.
"Even the foreign secretary must know this bill is a dogs dinner," said shadow foreign secretary Yvette Cooper.
"This bill is about failed Tory party management not the issues that matter for Britain in Europe. Instead of concentrating on things like growth, exports or cross border crime, William Hague is wasting time trying and failing to keep his eurosceptics happy.