The Government today vowed to fight the European Commission over efforts by Brussels to lift British social security restrictions designed to curb "benefit tourism".
Current social security rules limit benefit claims for immigrants to those who can prove they have a good prospect of finding work and have a long-term commitment to the UK. Migrants considered not to be "economically active" are turned down.
But now the Commission says the so-called "right to reside" rules break EU laws.
A Government spokesman insisted today that the current arrangements are "right for the UK" and prevent "unsustainable burdens being placed on our social security system".
However, the Commission's next step is likely to be formal infringement proceedings against the UK which could end in the European Court of Justice.
A ruling against the Government could force changes in the "Habitual Residency Test", introduced more than 25 years ago but tightened further in 2004, when EU expansion extended access rights to citizens of eight poor central European countries.
Government officials say that, without the current restrictions, the Treasury's annual benefits bill could soar by as much as £2.5 billion in payouts such as the jobseeker's allowance, currently only available to those who have previously worked for at least a year in the UK, and income support.
The Government spokesman said: "We are in discussions with the Commission as, in our view, the current rules are within the law and are right for the UK, and changing them now would not be in our interest.
"Our rules fully support the freedom of workers within the EU, whilst making sure that there are reasonable restrictions on access to social security for those who have never worked in the UK.
"This prevents unsustainable burdens being placed on our social security system. We will argue our case and work towards a favourable outcome."
The Commission stepped in after a complaint from an unnamed individual, and, after an initial inquiry, replied in a letter from the Commission's Directorate-General for Employment, Social Affairs and Equal Opportunities, saying that it is up to each EU country to set the terms of national social security and assistance schemes, including conditions surrounding the handing out of benefits.
But the letter, seen by the Daily Mail, goes on: "However, when making use of this competence, member states have to comply with the fundamental principles of EU law, such as the right to equal treatment on the basis of nationality."
The letter says that after examining the "right to reside" test, "it is not compatible with different legal provisions of EU law".
The row centres on the Commission's bid to co-ordinate national social security systems in the EU.
The UK system is considered one of the most generous, making the country attractive for migrants from the poorer central European member states - including those with no intention of working but hoping to live off benefits.
The Commission is now conducting a more detailed study of the measures against benefit tourism with a formal warning to the Government expected in the next few months.