LONDON (Reuters) - Britain’s top court backed a government attempt to limit immigration by ruling on Wednesday that an income test for those who want to bring their non-European spouses to the UK is acceptable and does not infringe human rights.

Britain's Prime Minister Theresa May speaks during a high-level meeting on addressing large movements of refugees and migrants at the United Nations General Assembly in Manhattan, New York, U.S., September 19, 2016. REUTERS/Lucas Jackson - RTSOHBK

Prime Minister Theresa May introduced a rule in 2012 when she was interior minister that Britons who wanted to bring spouses from outside the European Economic Area to the UK had to be earning at least 18,600 pounds ($23,170) a year.

The Supreme Court said the minimum income requirement had caused significant hardship to many, but ruled that in principle it was not inconsistent with the European Convention on Human Rights.

“The fact that a rule causes hardship to many, including some who are in no way to blame for the situation in which they now find themselves, does not mean that it is incompatible with the Convention rights or otherwise unlawful at common law,” the court said.

The income threshold, it added, was “part of an overall strategy aimed at reducing net migration,” with aims that were “no doubt entirely legitimate.”

However, campaigners who had claimed the income bar was a breach of human rights to a family life celebrated caveats to the ruling.

The court said the current rules did not adequately account for the protection of children or the possibility that alternative sources of funding be allowed other than the income of the Briton. Currently, the income of the non-European spouse does not count towards the income requirement.

“These are significant victories for families up and down the country,” said Saira Grant, Chief Executive at the Joint Council for the Welfare of Immigrants.

“This judgment confirms that the government’s position is now untenable and they must now take immediate steps to protect the welfare of children in accordance with their legal duty.”

The interior ministry said the court had endorsed its approach in setting an income threshold for family migration that prevents burdens on the taxpayer.

“This is central to building an immigration system that works in the national interest,” it said in a statement.

It added however: “We are carefully considering what the court has said in relation to exceptional cases where the income threshold has not been met, particularly where the case involves a child.”