BERLIN (AP) — The mayor of a small German town said Tuesday he was happy to be alive after being attacked with a knife by a man who confronted him over his welcoming stance toward refugees before slashing his neck.

The knife attack on Andreas Hollstein, the 54-year-old mayor of Altena in western Germany, prompted widespread shock and condemnation from officials including German Chancellor Angela Merkel. Authorities said the incident Monday night appeared to be motivated by the man's hatred of foreigners.

"I'm shocked by the knife attack on mayor Andreas Hollstein — and very relieved that he is back with his family," Merkel said. "Thanks also to those who helped him."

The attacker was identified by authorities as 56-year-old German Werner S., whose full name was withheld because of German privacy laws.

Hollstein, a father of four and a member of Merkel's conservative party, appeared shaken as he answered reporters' questions the day after the attack.

"I feared for my life," he said adding that it appeared the man had intentionally chosen him as a victim.

"If you ask me whether that knife in his pocket was for me, I'd answer with a yes," he said.

The mayor said he was at a local kebab restaurant around 8 p.m. (1900 GMT) on Monday, when the attacker approached him, held a knife to his throat and took him to task over his policies toward refugees. It was only with the help of the restaurant's owner and his son that the man could be overpowered. Police later arrested the assailant.

Hollstein was taken to the hospital but discharged later Monday. He said he had a 15 centimeter-long (5.9 inches) cut on the left side of his neck.

Prosecutor Gerhard Pauli said Werner S. was drunk when he attacked Hollstein with a 34 centimeter-long (13.4 inch) kitchen knife. He said the man didn't have any known links to far right groups, but that "hatred toward foreigners" appeared to be the motivation for his attack.

The mayor became known nationally for voluntarily taking in more asylum seekers than Altena was obliged to since the height of the refugee crisis two years ago.

Hollstein said the attacker had probably been incited by the poisoned atmosphere fuelled by parties such as the nationalist Alternative for Germany which has relentlessly campaigned against migrants and their supporters.

Still, Hollstein said the attack would not deter him from continuing to stand up for refugees and all others who needed his support.

Armin Laschet, the governor of North Rhine-Westphalia state where Altena is located, said "the security agencies assume the attack has a political background."

The incident in Altena has been compared to a knife attack two years ago in which a far-right assailant stabbed a politician who was campaigning to become mayor of Cologne. The attacker was angered by the government's refugee policy.

Henriette Reker, who was in charge of housing refugees in Cologne at the time, was elected mayor the following day while still in an induced coma. She has since made a full recovery.

Germany took in more than 1 million asylum seekers between 2015 and 2016, mostly from war-torn countries such as Syria, Afghanistan and Iraq. The influx saw an outpouring of support from many Germans who wanted to help the refugees, but also a sharp rise in the number of attack against migrants and sometimes also against their supporters.