The European Court of Justice has ruled that unemployed EU citizens who go to another member state to claim benefits may be barred from some benefits, reports GHN based on BBC.
The ruling on so-called "benefit tourism", relating to a case in Germany, could set an important legal precedent for the rest of the EU.
It could allow the UK to exclude some unemployed migrants from receiving some benefits such as jobseeker's allowance.
David Cameron is looking a range of options to curb EU migration.
The government has already tightened the rules on the ability of new EU migrants to claim certain benefits for the first three months after they arrive in the UK.
The prime minister has said he wants to go further and will set out his plans in a speech before the end of the year, amid pressure from Conservative backbenchers to act.
Tuesday's ruling relates to a case involving a Romanian woman and her son living in Germany who had been denied access to a non-contributory subsistence allowance from the German social security system.
The court decided the German authorities were right to refuse her request, and there was no discrimination involved in denying her access to a non-contributory benefit which is available to German citizens.
It said the defendant did not have sufficient financial resources to claim residency in Germany after the initial three months and therefore could not claim that the rules excluding her from certain benefits was discriminatory.
More broadly, it said the right of EU citizens to live and work in other member states - the principle of freedom of movement - did not stop states passing legislation of their own excluding migrants from some non-contributory benefits available to their own citizens.
National Parliaments have the "competence to define the extent of the social cover" offered in the way of certain non-contributory benefits, it stated.
"The directive thus seeks to prevent economically inactive European Union citizens from using the host member state's welfare system to fund their means of subsistence." the European Court of Justice said in a statement.
"A member state must therefore have the possibility of refusing to grant social benefits to economically inactive European Union citizens who exercise their right to freedom of movement solely in order to obtain another member state's social assistance."