Hungarian Prime Minister Viktor Orban gives a speech during his visit at the Bavarian state parliament in Munich, Germany October 17, 2016. REUTERS/Michael Dalder

BUDAPEST (Reuters) - Hungary will sue the European Commission and resist mandatory migrant resettlement quotas if Brussels does not take them off the agenda, Prime Minister Viktor Orban said on Friday.

Orban said his government would use a recent referendum in Hungary, in which the overwhelming majority of those who voted rejected the EU quotas, to challenge Brussels. Turnout for the vote was too low to make it legally binding.

He said there was a stalemate on the issue right now; Slovak Prime Minister Robert Fico, who holds the rotating EU presidency, is to propose a solution by the next EU summit in December.

Orban told state radio that if the European Commission did not give up the idea of quotas, “then we will resist ... we will not carry out (the EU decision), we will sue the Commission”.

“There will be a serious legal debate on whether a foreign population can be imposed on the people of an EU member state against its will,” he added. “This will be a big battle, and for this we need the (amended) constitution.”

Orban says deciding whether to accept migrants is a matter of national sovereignty, and wants to amend Hungary’s constitution next month to ban the settlement of migrants there.

Orban responded to the influx of migrants last year by sealing Hungary’s southern borders with a razor-wire fence and thousands of army and police. He says Hungary, with its Christian roots, does not want to take in Muslims in large numbers, and that they pose a security risk.