David Cameron was pitted in a game of competing parliamentary procedures today, as he tried to use a private member's bill to outflank a rebel amendment to his Queen's Speech.
The unprecedented turn of events served to divide the eurosceptics in his own party and could still distract the press away from what is likely to be a baffling and dramatic amendment vote tomorrow.
"You don't need a commentator to be here to discuss what has happened to the Conservatives, you need a psychiatrist," former Tory MP and political commentator Matthew Parris told the BBC.
Downing Street published a draft bill this afternoon giving legal weight to the pledge to hold a referendum on EU membership in 2017.
It states that the referendum must be held before December 31st 2017 and that the question to appear on the ballot papers will be: "Do you think that the United Kingdom should remain a member of the European Union?"
A backbencher is likely to carry the bill forward on Thursday, when the ballot for private members bills takes place.
The top seven backbenchers chosen can expect a whole day to debate their bill, with the first slot coming up on July 12th.
Cameron is hoping the private member's bill will distract attention from the amendment debate tomorrow, in which backbenchers will be given a free vote but ministers will be permitted to abstain.
That strange situation will see governing party MPs vote against their own legislative agenda, in a symbolic act which significantly damages the prime minister's authority.
But the use of a private member's bill is problematic because it can be talked out by a determined group of MPs.
Rebels hold firm
Several Tory troublemakers, including John Baron and his ally Peter Bone, have rejected the Downing Street effort.
John Redwood told the BBC he wanted a referendum much earlier than 2017.
"We, the Conservative party, voted en masse against Nice and Amsterdam and Lisbon - three massively centralising treaties that took powers away from our country," he told the BBC.
"We never agreed to them. We want them sorted out. We do not think Britain can be governed properly under them. And it is urgent. It can't wait until 2017."
Ukip leader Nigel Farage said the hostility toward the prime minister in the Conservative party suggested he was on the verge of being toppled.
"This isn't just about Europe, this isn’t just about some obscure treaty - this is about the impact on jobs and growth, it’s about cost, it’s about immigration, all of these things are now seen by the British public to be part of the European dimension and unless this prime minister gets to dealing with it, then I have a feeling that at some point next year his own party may get rid of him," he said.
Currently the Queen's Speech amendment has been signed by 67 Tories, six DUP MPs and five Labour MPs.
But Cameron's publication of a draft bill answering the complaints of many rebels is his best chance yet of silencing his 'bastards' – the description John Major offered of the eurosceptic Cabinet ministers who nearly destroyed his leadership.
Speaking to the Huffington Post, Major's press secretary, Sheila Gunn, said the Conservative party was making the same mistakes it made in the 90s.
"One of the differences is that was when the Conservatives had been in power for 17 or 18 years. Now the Conservatives have only been in power in coalition for two or three years," she said.
"You could also say now that the Conservative party is handing the election to the Labour party."
Divide and rule
There were some signs Cameron had managed to at least divide the eurosceptic opposition to him in his parliamentary party.
Michael Fabricant said the publication of the draft bill had convinced him to abstain during the amendment debate tomorrow.
Veteran Tory eurosceptic and rebel Douglas Carswell wrote in his blog: "Thank you, prime minister. That'll do.
"As a member of Better Off Out, who has been campaigning for an in/out referendum, I feel I can now say: 'Yes. Thanks, prime minister. On matters Europe, that's what I wanted'."
Influential Tory eurosceptic MEP Daniel Hannan tweeted: "The moving of an EU referendum bill gives souverainistes everything we have been asking for. Now the pressure is on Labour."
But even if the draft bill manages to quell discontent, the debate has already done serious damage to Cameron's leadership.
His refusal to say how he would vote if the referendum took place today while delivering a joint press conference with Barack Obama yesterday looked shifty and evasive.
This morning's editorials would not have made pleasant reading either. From left and right, newspaper editorials suggested he was losing his control of the Conservative party.
"For the ordinary voter, this mess is utterly bewildering," the Daily Mail said.
The Independent said: "The damage to the prime minister's authority is so catastrophic that it barely matters that neither Michael Gove nor Philip Hammond will put their name to the forthcoming vote.
"Mr Cameron was reduced to a blustering dismissal of their remarks – from the US – on the grounds that, since there is to be no immediate referendum, they are merely 'hypothetical'. So weak a response speaks volumes of the weakness of his position."