COPENHAGEN (Reuters) - Denmark will no longer automatically accept a quota of refugees under a U.N. resettlement program after passing a law on Wednesday that enables the government to determine how many can enter each year.

Since 1989, Denmark has agreed to take 500 refugees a year selected by the United Nations under a program to ease the burden on countries that neighbor war zones.

But after the European migration crisis in 2015 brought almost 20,000 claims for asylum, Denmark has refused to take any U.N. quota refugees.

Under the new law, the immigration minister will decide how many refugees will be allowed under the U.N. program, with 500 now the maximum except in an “exceptional situation”.

“It’s hard to predict how many refugees and migrants will show up at the border to seek asylum, and we know it may be hard to integrate those who arrive here,” Immigration and Integration Minister Inger Stojberg said last month when her ministry proposed the law.

The opposition Social-Liberal Party said opting out of the U.N. program would increase pressure on countries already accommodating large numbers of refugees, and the move could encourage other countries to follow suit.

Last year, more than 6,000 people claimed asylum in Denmark. Between January and November this year just over 3,000 people did.

(Corrects throughout to show new law only applies to U.N. resettlement quota, not other refugee applications.)