Hungary will hold a referendum on October 2 on troubled EU plans to relocate migrants among member states, a scheme fiercely opposed by right-wing Prime Minister Viktor Orban, the president said Tuesday.

'As president of the republic I decree that the referendum will be held on October 2,' Janos Ader said in a statement.

Orban's government voted against the European Union's plan to share 160,000 migrants around the 28-nation bloc via mandatory quotas, but the scheme was approved by a majority of member states in September.

Scroll down for video

Right wing Hungarian PM Viktor Orban wants to ignore EU plans for member states to accept migrants

Hungary has erected razor wire along its border with Serbia to try and stop illegal immigration, file pic

Hungarian police regularly arrest those who attempt to enter the country illegally and bring them to court

Hungary has joined Slovakia in filing a legal challenge against the plan, which was meant to ease pressure on Greece and Italy, the main entry points into the bloc for migrants fleeing the Syrian civil war.

Budapest said earlier this year that the issue would be put to a referendum. Orban has said that the EU has no right to 'redraw Europe's cultural and religious identity'.

Voters will be asked: 'Do you want the EU to prescribe the mandatory relocation of non-Hungarian citizens to Hungary without the approval of the Hungarian parliament?'

Budapest says that the plan - which has been extremely slow to get going - violates its national sovereignty and that 'terrorists' might enter the country disguised as migrants.

As of July 1, fewer than 2,800 people - 789 from Italy and 1,994 from Greece - have been relocated, according to EU data. Hungary has made zero places available but is meant to take in 1,294 people.

Orban has long had a testy relationship with Brussels with critics saying that his shake-up of Hungarian institutions from 2010 - since mirrored in fellow EU member Poland - has undermined democracy.

But his stance during Europe's migrant crisis, which has seen more than a million people undertake a perilous journey to the continent, has cause particular ire.

Around 400,000 migrants passed through Hungary before the country sealed its southern border

Around 400,000 migrants and refugees passed through Hungary in 2015 before the government sealed off the southern borders with razor wire and fences in the autumn.

The authorities also brought in tough new laws punishing illegal entry and vandalism of the fences. Last year the government erected billboards warning foreigners not to take jobs from Hungarians.

Orban said after Britain's June 23 referendum decision to leave the EU - he had urged Britons to remain in adverts taken out in British newspapers - that a big factor was immigration.

'The British wanted to find a way to resist this exodus of modern times,' Orban said.

EU leaders 'have done nothing to stop the wave of migration... which has led to less security, an increase in danger and aggression.'

Hungary's opposition Socialist Party accused Orban on Tuesday of wanting to pull Hungary out of the EU 'using the wildest lies'.

The government is planning a billboard, television and Internet campaign urging voters to 'send a message to Brussels that they will understand!'