The threat of legal action by the European Commission over Britain's restrictions on benefits for migrants risks "blowing the Government's immigration policy out of the water", campaigners said today.
The ruling that the UK's "right to reside" test on EU nationals based in the country is a breach of EU law is "an open invitation to benefit tourism", the campaign group Migration Watch UK said.
It comes as Work and Pensions Secretary Iain Duncan Smith warned the move could leave taxpayers facing a £2 billion bill.
He told the Daily Telegraph the move threatened to break the "vital link" which should exist between taxpayers and their own government.
Sir Andrew Green, chairman of Migration Watch, added: "This ruling is an open invitation to benefit tourism.
"A three-child family would receive £29,000 in benefits.
"Clearly this risks blowing the Government's immigration policy out of the water. It must be vigorously opposed."
Brussels threatened it will take legal action unless the test - which determines who qualifies for specific social security benefits - is dropped.
A Commission statement said the Government has two months to advise Brussels what it is doing to bring domestic social security rules in line with EU requirements.
"Otherwise, the Commission may decide to refer the UK to the EU's Court of Justice," it said in a statement.
Mr Duncan Smith is currently spearheading reforms to the country's benefits system, bringing in the Universal Credit.
He said: "The EU settlement is supposed to protect the right of member states to make their own social security arrangements.
"But we are now seeing a rising tide of judgments from the European institutions using other legal avenues to erode away these rights, and we should be gravely concerned.
He added: "As if this week's decision was not bad enough, we are also fighting increasing demands for the UK to pay benefits to those who have long since moved abroad, and who may never have made more than a token contribution to UK society."
Yesterday, Employment Minister Chris Grayling said the ruling was a "a very unwelcome development".
"It's obviously right that we support those who work and pay their taxes here, but it's clearly completely unacceptable that we should open our doors to benefit tourism," he said.
"I'm really surprised that the European Commission has chosen to go into battle on this very sensitive issue, when there are clearly far more pressing problems to solve in Europe."
Under UK rules a range of benefits - child benefit, child tax credit, state pension credit, jobseekers' allowance and unemployment support allowance - are only given to those with a "right to reside".
That is automatic for UK nationals , but residents from other EU countries have to pass a "right to reside" test.
The Commission said this means the UK is indirectly discriminating against nationals of another member state, in breach of EU social security co-ordination rules under which EU citizens have the same rights and obligations as nationals of their host country.
It added that EU-level rules on who qualifies as a resident of a different member state are strict enough to make sure that "only those persons who have actually moved their centre of interest to a member state (other than their own) are considered habitually resident there".
But Conservative MEP Julie Girling criticised the move as an interference by "unelected bureaucrats" in UK domestic policy.
Robert Oxley, campaign manager of the TaxPayers' Alliance, said Britain "can't afford to be exporting benefits to the rest of Europe".
He said: "It's already far too easy to take advantage of a welfare system that is meant to be there to help the most vulnerable in society.
"Opening up benefits to those without proper ties to the UK will only increase the cost of the system and the amount of money lost to fraud."
Ukip leader Nigel Farage added: "It is no longer the case that an elected British Government can decide where and to whom British taxpayers' money is sent or for that matter who may or may not live here.
"That decision is now in the hands of foreign politicians and unelected foreign judges.
"The only way that is available to us to make decisions on behalf of British people is to set laws at home. And to do that we need to govern ourselves."
Mr Grayling condemned the timing of the commission's action ahead of a meeting of EU ministers in three weeks' time to discuss how the rules are being implemented across the union.
"Just at the moment when we are starting a proper debate within the EU about sorting out rules that are currently all over the place, they have sought to launch a formal legal process which I think is ill-timed, it is ill-judged, and is simply going to prompt controversy at a time of great sensitivity for the European Union," he told BBC Radio 4's The World At One.