[Read: Following attack, Germans are told far-right terrorism is the number one threat.]

The party seized on Chancellor Angela Merkel’s decision to welcome over a million migrants to Germany in 2015, actively fanning fears of Islamization and migrant crime. Two years later, the AfD became the first far-right party to enter Parliament since World War II. By now, it sits in every state legislature in the country.

Yet the AfD itself is deeply split. In one camp are disillusioned conservatives, often former members of Ms. Merkel’s Christian Democrats, who feel alienated by what they perceive as a shift to the left of their old party on issues like migration, same-sex marriage and climate change.

In the other are hard-line nationalists like Mr. Höcke, who use language laced with ethnic hatred and close ranks with neo-Nazis during street protests.

The ideological split is also a geographic one: The far right is more moderate in western Germany — but also less successful, trailing far behind Ms. Merkel’s conservatives and garnering less than half the support of the resurgent liberal Greens.

In the former East, meanwhile, it has become a broad-based political force embedded at the grass-roots level.

“East Germany has become a refuge for the far right, a place where you can gather your strength, logistically and mentally,” Mr. Quent said.