BERLIN — The mayor of a German town in the spotlight for its treatment of refugees has vowed to keep representing “those who have fled here and those who have been here,” after a citizen angry with his open-door policies plunged a knife into his neck.

Andreas Hollstein, 54, mayor of the western German town of Altena, told a news conference on Tuesday that he had stopped at a kebab stand late Monday when he was approached by a drunken man who yelled, “You leave me to go thirsty and bring in refugees.”

The incident comes as Germany faces political turmoil after elections that resulted in seven parties winning seats in Parliament. Among them, for the first time, was the far-right Alternative for Germany, which campaigned on fears surrounding Chancellor Angela Merkel’s decision in 2015 to open the country’s borders to more than a million people seeking asylum.

The man who attacked Mr. Hollstein wounded him in the neck before being wrestled to the ground by the owner of the kebab stand and his son, who together seized the footlong knife.