The European Commission believes Britain is flouting EU rules by not allowing nationals from member states the same access to benefits as UK citizens.
It is alleged that Britain's actions could have prevented migrants working and living in the UK from claiming some benefits. Details of the legal action will be announced later on Thursday.
A Government spokesman said the right to reside test was a "vital and fair tool" to ensure benefits are only paid to people who are legally allowed to live in Britain.
"It is absolutely imperative that we do all we can to protect our benefits system from abuse by migrants," he said.
"The 'right to reside' part of our habitual residence test is a vital and fair tool to ensure that benefits are only paid to people who are legally allowed to live in Britain. We have always been clear that we believe our rules are in line with EU law."
Stephen Booth, research director of the think tank Open Europe, said the row is over EU nationals having to "jump through the extra hoop" of a right to reside test before getting benefits, while UK citizens do not.
Mr Booth warned that the Commission could undermine public confidence in the principle of free movement within the EU by being "legally fundamentalist".
He told BBC Radio 4's Today programme: "What is also important to understand here is the UK has a particular welfare system that is universalist and involves lots of means tested benefits, unlike on the continent where a lot of it is based on contributions. So we have a system that needs safeguards in order to ensure that only people who are eligible can claim benefits and that's what the right to reside is meant to ensure."