Hungarians who voted in a referendum have overwhelmingly rejected European Union migrant quotas.
Hungary's right-wing Prime Minister Viktor Orban hailed the vote as "outstanding" and said it must be taken into account by EU decision makers.
With most votes counted, 98.2 percent rejected the quotas - but the result was expected to be invalid as the turnout was under the 50 percent required.
Mr Orban said he would submit an amendment to Hungary's constitution to put the result of the plebiscite into law.
"Thirteen years after a large majority of Hungarians voted at a referendum to join the European Union, today Hungarians made their voices heard again in a European issue," he said.
"We have achieved an outstanding result, because we have surpassed the outcome of the accession referendum."
Mr Orban opposes plans to relocate 160,000 migrants across the EU under which Hungary would receive almost 1300 asylum seekers.
During last year's migrant crisis, Hungary became a transit state for people going to other EU countries and it eventually sealed some borders.
- BBC / Reuters