Hungary's top court gave its green light Tuesday for Budapest to hold a referendum on EU plans to relocate migrants among member states, a move fiercely opposed by conservative Prime Minister Viktor Orban.

The Supreme Court, which had been asked to rule on the EU's mandatory migrant quota by two small opposition parties, approved the referendum question proposed by the government.

It will ask voters: ‘Do you want the EU to prescribe the mandatory relocation of non-Hungarian citizens to Hungary without the approval of the Hungarian parliament?’

Budapest wants to hold the referendum between August and December. It began campaigning for a ‘No’ vote in early April, notably warning that ‘terrorists’ might enter the country disguised as migrants.

Orban's government claims that the plan to relocate 160,000 asylum-seekers among member states via quotas, agreed by EU member states in September, violates its national sovereignty.

Orban's government voted against the plan, and in December joined Slovakia in filing a legal complaint.

The European Commission insists that the plan was decided by ‘a decision-making process on which all member states agreed,’ and that it is legally binding.

In a last attempt to block a referendum, the small Liberal Party announced on Tuesday that it has asked the country's constitutional court to rule on the matter, stressing that such a vote would risk ‘strengthening xenophobia (which is) already strong in Hungary’.

It is considered unlikely the constitutional court will veto the decision to hold a referendum.

In practice the EU relocation agreement is being implemented slowly: by early April only around 1,100 of the 160,000 asylum seekers had been shared out, none of them transferred to Hungary.