WARSAW (Reuters) - Poland is working on regulations that would allow it to detain asylum seekers in border camps, the interior minister said on Thursday, arguing such a policy has served Hungary well despite it being criticized by the United Nations.

Poland, Hungary and other central European EU member states are opposed to an European Commission plan to distribute migrants from Africa and the Middle East across the bloc.

But unlike Hungary, Poland - a country which issued over a million work permits for neighboring Ukrainians last year - has not seen thousands of migrants from Africa and Middle East storm its borders.

“My task is to assure the safety of Poles. We must be also prepared for this bad scenario, which I hope will not happen,” Blaszczak told state television. “The bad scenario is a wave of migration that could sweep across Poland.”

Asked on Radio Zet if Blaszczak would place migrants in camps made from shipping containers behind barbed wire, he replied: “This is an idea for an emergency situation which has worked well in Hungary.”

Hungary, one of the focal points of Europe’s migration crisis since 2015, last month approved a law to detain migrants in border camps, a step which the United Nations said violated EU law and would have a “terrible physical and psychological impact” on asylum seekers.

Blaszczak also reiterated that accepting migrants under the EU plan to distribute them could pose security risks for Poland.

“There were no terror attacks in Poland because Poland has backed out of a decision that was taken by the previous government to accept thousands of migrants called refugees,” Blaszczak told state television.

The migrant relocation plan was decided by EU leaders in September 2015 despite Hungary, the Czech Republic, Slovakia and Romania voting against it. Although generally opposed to it, Poland’s previous centrist government voted with majority.

On Wednesday, the EU executive arm stepped up pressure on Poland and Hungary to take in asylum seekers under the bloc’s plan.