European court gives UK visa direction
The UK cannot block family members who are originally from outside Europe but now live in the EU entering the country without a visa, European judges say.
They were ruling on the case of Spain-based Sean McCarthy, a dual British and Irish national, and his Colombian wife.
The couple argued she should be able to travel to the UK to see her British family without applying for a permit.
The BBC's Danny Shaw said the decision could open up UK borders to other non-EU nationals living in Europe.
A Downing Street spokesman said Prime Minister David Cameron disagreed with the ruling.
The McCarthys took action against the government under the EU's freedom of movement rules.
Patricia McCarthy Rodriguez argued she should be allowed to travel to the UK with her British family without having to obtain a British visa as she holds an EU Residence Card issued by the Spanish government.
The British government has until now required Mrs McCarthy to obtain a "family permit" visa every six months if she wants to travel to the UK.
The couple argued their right to freedom of movement was being infringed.
The European Court of Justice (ECJ), which interprets EU law, backed the McCarthys, saying the UK cannot demand that family members of EU citizens resident in the EU have to have a special visa to come to the UK.
It said concerns over abuse of rights and fraud did not justify the measures.
Analysis: BBC home affairs correspondent Daniel Sandford
At a time when the government is trying to reduce the number of non-British citizens coming to the UK, this is an awkward ruling.
On the face of it the ruling is logical, if all EU citizens have the right to come and go freely from Britain, then surely their spouses should be allowed to also.
But the government's concern is that sham marriages to EU citizens accompanied by easy-to-obtain residence papers in some EU countries would become another back door into Britain.
The prime minister's spokesman argues there is no consistency in the EU on residence cards.
But the court ruled that restricting freedom of movement of EU citizens spouses could not be justified even when if there are a high number of fraudulent cases.
Mr McCarthy said he was "overjoyed" by the ruling.
He added: "As a British national I had expected my country to play by the rules, and now the court has finally forced the UK to respect British and European citizens' free movement rights."
The ruling only covers cases where the partner from the EU - in this case Mr McCarthy - has exercised their right to free movement within the union. If someone still lives in their home country, their spouse is not entitled to free movement.
The ECJ delivers guidance for the UK courts on how they must interpret European law. The case will now return to the High Court.
The UK government introduced the visa rules because it had concerns over security standards in other EU countries.
Mr Cameron's spokesman said the government would decide how to respond after the High Court ruling.
But the UK's approach was "the right one", he added.
UKIP MEP and spokesman on immigration Steven Woolfe said: "This is yet more proof that Britain can never take back control of its borders as long as it remains in the European Union."