The outgoing head of the European Commission, Jose Manuel Barroso, has fired a parting shot at David Cameron that has massively strengthened the position of Ukip and Tory Eurosceptics.

By insisting the prime minister's much-hyped plans to cap immigration would be illegal, he has also suggested the UK is walking itself out of the EU.

And that is exactly what Nigel Farage and the prime minister's backbench Euro rebels have long claimed and, in fact, are hoping for.

They are delighted to see the prime minister apparently running so scared of Ukip that he has painted himself into a corner where he will be unable to renegotiate the founding EU principle of freedom of movement as promised and will, as a result, have no option but to recommend withdrawal.

After the prime minister's big conference speech last month, where he promised exactly that fundamental renegotiation and declared he would "not take no for an answer", he has left himself little room for manoeuvre.

Any softening would be seen as a climbdown, would be unacceptable to his backbench rebels and would hand Ukip another advantage.

But there remains huge confusion over exactly when the prime minister is planning to make his pivotal speech or whether he yet knows what he is going to propose in it.

After his conference declaration, party managers suggested the speech was imminent and it was speculated, without contradiction, it might come before the crucial Rochester by-election, which is a make-or-break contest between Cameron and Farage.

That led to claims the prime minister was so terrified of Ukip he was throwing out any promises to head off the threat.

But the timing has since been subjected to massive confusion with contradictory statements coming from spokesmen. The latest position appears to be either "in due course" or "before Christmas", depending on who is asked.

Nigel Farage
Nigel Farage agrees a migrant cap would be illegal Reuters

Barroso's comments, in a speech and a BBC TV interview, have at least offered some clarity about the level of the challenge facing the prime minister as he attempts to square an impossible circle.

"It seems to me that any kind of arbitrary cap is against a fundamental principle of the treaties, that is freedom of movement, and that I'm sure it will not be accepted," he said.

"And it is an illusion to believe that space for dialogue can be created if the tone and substance of the arguments you put forward question the very principle at stake and offend fellow member states.

"It would be an historic mistake if on these issues Britain were to continue to alienate its natural allies in central and eastern Europe, when you were one of the strongest advocates for their accession."

He also said Britain would lose diplomatic clout if it left the EU and urged the prime minister to learn the lesson from the Scottish independence campaign and start making a powerful pro-EU case now.

It is likely the prime minister will use an EU summit at the end of this week to further sound out other leaders about his options. But all the indications are he will receive a chilly response.

His task is huge. He has to find a way of agreeing some sort of new controls over EU immigration with the other 27 leaders but which do not destroy the principle of freedom of movement.

And, potentially more difficult, they have to be policies that will satisfy those voters and Tory backbenchers who have long ago decided nothing will answer their concerns except withdrawal from the EU.