European Council President Donald Tusk at a conference in Bratislava on May 28 2017 | Stringer via Gett Images Tusk slams Polish PM for Auschwitz comments Polish PM accused of using Holocaust to defend anti-immigrant stance.

European Council President Donald Tusk admonished Polish Prime Minister Beata Szydło on Wednesday for using the Holocaust to defend her government’s anti-immigration stance.

Szydło earlier on Wednesday said, "In today's restless times, Auschwitz is a great lesson showing that everything must be done to protect the safety and life of one's citizens," during a memorial service at the extermination camp.

The comment was widely seen as a defense of Poland's refusal to accept refugees in accordance with a mandatory EU relocation scheme.

Szydło’s Law and Justice party first tweeted the comment and then removed it after it sparked social media outrage.

Tusk, who is a former prime minister of Poland, tweeted, "Such words in such a place should never come from the mouth of the Polish prime minister."

However, Szydło’s defenders said her political enemies were looking for offense where none was intended.

Rafał Bochenek, a government spokesman, tweeted, “If someone is looking for bad intentions they can find it in any comment,” and recommended listening to Szydło’s full speech.

The Polish government leader was in Auschwitz to commemorate the 77th anniversary of the first Nazi deportations of Poles to the camp. In the early years of the war the camp served mainly as a political prison for Poles, but after 1942 became one of Germany’s main death camps, in which more than 1 million Jews were murdered.

The juxtaposition of Auschwitz and the current controversy around Poland’s refusal to take in asylum seekers under a 2015 EU deal is uncomfortable for the government. The European Commission this week launched infringement procedures against Poland, Hungary and the Czech Republic for refusing to follow through on the agreement.

However, there is strong resistance in Poland to taking in Muslim refugees, and the nationalist government has used the issue to buttress its public support.

Before the Second World War about 10 percent of Poland's population was Jewish, and there were also other large ethnic minorities. The killings of the war and post-war border changes and deportations left Poland as one of the most ethnically homogenous populations in Europe. There isn’t much appetite to become a multicultural society like those of Western Europe, and the government has pointed to the security risk of allowing large-scale Muslim settlement and to the fact that its policy has spared Poland terrorist attacks.

“These societies form enclaves which are natural supports for terrorism,” Interior Minister Mariusz Błaszczak warned in a recent radio interview, saying that Poland was threatened with “millions” of migrants. Under the 2015 deal, Poland’s previous liberal government agreed to accept 6,182 people.

Tusk has come under fire from the Warsaw government for not doing enough to protect the country from the demands of the Commission when it comes to taking in asylum seekers.

He is already locked in a feud with Law and Justice, which made a concerted but futile effort to dislodge him from his post as European Council president earlier this year.