The Alternative for Germany is a far-right German political party known for its xenophobia, anti-Islam beliefs, and pride in German identity.

After Sunday’s German elections, it is also now the country’s third-largest party — and the first far-right party to enter the German Bundestag (parliament) in six decades.

German Chancellor Angela Merkel, who won a fourth term Sunday, has already said she won’t work with the party in parliament. Still, the surge of support for the AfD alarmed observers inside and outside of Germany.

In part that’s because many believe a pact with the past has been breached. Far-right parties have been on the rise across Europe for years, but Germany had long seemed the exception. Germany’s Nazi history has been a heavy mantle in the postwar period, worn with particular gravitas since the end of the 1960s, when a new generation came of age and began to aggressively question the role their parents had played in the Second World War. That past has been invoked, again and again, as a shield against the rise of far-right parties.

Unlike the rest of Europe, Germany, it seemed, truly understood where extreme xenophobia can lead and was committed to preventing it from spreading once again.

That reassuring belief felt considerably weaker after this weekend’s vote.

“It’s quite concerning,” Ulrike Esther Franke of the European Council on Foreign Relations in Berlin told me. “This is a country which has had whole generations that have learned, more than anyone else, that [far-right, xenophobic parties are] a bad idea.”

The German education system teaches the Holocaust again and again during the course of a child’s schooling, and Holocaust denial is a crime in the country. And yet nearly 13 percent of the population pulled the lever for a party advocating a brand of xenophobia Germans have been indoctrinated against since World War II.

“[T]he AfD really dialed up its campaign very aggressively in the last week both on social media and on the street,” said Constanze Stelzenmüller, a senior fellow at the Brookings Institution. “It moved from dog whistle to a very overt challenging of German postwar taboos.”

The AfD is only four years old. In its toddlerhood, the AfD morphed from a party primarily concerned with opposition to the euro and Germany’s role in bailing out failing European economies into a party defined by anti-Muslim rhetoric, xenophobia, anti-migrant positions, pushing for border controls, and, most recently, a bold call to break with Germany’s tradition of accepting total guilt for its past.

It’s also cannily exploited continued divisions between former East and West Germany, picking up the majority of its supporters from the former German Democratic Republic, as East Germany was once called.

In former GDR-parts of Germany AfD is now a stronger party than social democrats SPD. pic.twitter.com/4FKwuUNw79 — Carl Bildt (@carlbildt) September 24, 2017

In its short life, the AfD has also torn through two different sets of leaders, a sign of its own growing pains and uncertainty. The latest came on Monday with a dramatic, and unexpected, statement by one of the party’s chairs, Frauke Petry, who announced she will serve in parliament as an independent, not for the party. (Confusingly, she did not actually leave the party, though now she’s saying she will eventually.)

“The entrance into the Bundestag of the far-right Alternative for Germany party will fundamentally alter German politics,” said professor Stephen Silvia of American University, “because it will shift Germany's political center of gravity significantly to the right and put on the agenda topics that the centrist parties took great pains to avoid, such as immigration, multiculturalism, and the costs as well as the benefits of being in the European Union.”

But how did we get here? With the AfD hoping to shake up the German parliament, it’s worth taking a close look at the party’s trajectory to understand how it came to be seen as a viable protest vote.

It began with economists disgruntled about the Greek bailout

The AfD was founded in 2013 by a handful of economists, academics, and former members of Merkel’s own Christian Democratic party. It was considered something of a protest party with a euroskeptic platform but not a notably nativist one. The AfD’s founders advocated that Germany pull out of the common currency in the wake of the Greek economic crisis, but said the country should remain in the European Union itself.

One founder was a Hamburg economics professor named Bernd Lucke. Just two years after the AfD was born, Lucke formally severed ties with the party he created. In a letter excerpted by Reuters, he bemoaned how the party had moved toward Islamophobia, xenophobia, and pro-Russian sentiment.

“I certainly made my share of mistakes, and among the biggest was realizing too late the extent to which members were pushing the AfD to become a populist protest party,” the letter read.

Carl Berning, a political scientist at the Johannes Gutenberg University of Mainz, told me this summer that an early version of the AfD “focused on the euro and showed almost no evidence for populist or radical positions," but that the newer iteration had shifted markedly to the right.

“The more radical wings of the party gained power and now shape the profile of the party,” he said.

The rising xenophobia and Islamophobia in the AfD that Lucke was responding to grew worse over the course of 2015, in direct response to Merkel’s open-door refugee policy.

By December of that year, almost 900,000 migrants, asylum seekers, and newcomers had come into Germany. The AfD capitalized on growing anxiety that the immigrants — especially Muslim immigrants — would fundamentally change German society.

Though the numbers of refugees dropped dramatically in 2016, simmering resentment on the far right in Germany at times turned violent. According to the Funke Media Group, some 3,500 far-right attacks on refugees and refugee homes were carried out in 2016, leaving hundreds injured.

And yet prior to Sunday, it seemed possible to believe that Merkel’s government wouldn’t pay too high an electoral price for the worst of those anti-migrant feelings. Merkel had worked on a deal with Turkey to keep some migrants, and she was a driving force behind a controversial deal hammered out between the EU and Libya this summer designed to stem the flood of migrants making the dangerous trip across the Mediterranean by propping up the Libyan Coast Guard.

Those actions may have helped mitigate mainstream anxiety over not only the flood of migrants but also the fears stoked by a terror attack allegedly perpetrated by a Tunisian immigrant in a Berlin Christmas market last December that killed 12 and injured 49, as well as mass sexual assaults carried out in Cologne over New Year’s Eve that affected more than 1,000 women and were apparently carried out, in part at least, by migrants and new arrivals.

But not all Germans had fully moved past their terror fear. After all, other parts of Europe were experiencing terror attacks.

The AfD channeled that worry and exploited anti-migrant feelings that had been building steadily over the previous two years.

In 2015, the AfD began to echo the other far-right parties of Europe

In 2015, a former chemist and mother of four named Frauke Petry (she’s since had her fifth child) took the helm of the AfD. Under Petry, the focus of the party shifted still further toward harsh opposition to immigration and refugees.

In spring 2016, a draft of an AfD platform picked up in the press including explicitly anti-migrant policies like banning minarets and the niqab (the veil that covers the lower part of a woman’s face that some observant Muslim women wear), and encouraged German women to embrace motherhood. Party spokespeople began talking about how Islam was incompatible with German political and cultural values.

To the German weekly magazine Der Spiegel, Petry worried aloud that “the immigration of so many Muslims will change our culture.” It was the kind of statement that prompted a great deal of handwringing in the mainstream press.

She even went so far as to tell the press that the border police "must prevent illegal border crossings and even use firearms if necessary” to stop undocumented migrants from crossing into Germany. That comment prompted a slew of condemnation from across the political spectrum.

But such anti-migrant rhetoric didn’t actually diminish support for the AfD; in fact it began to rise. By September 2016, the party was polling around 16 percent in national polls and had edged out Merkel’s Christian Democrats in two regional elections and taken seats in nine out of 16 regional legislatures. (Prior to yesterday’s election, it held seats in 11 out of the 16 regional legislatures.)

Then it seemed the AfD had hit a peak in late 2016 and early 2017, when polls showed support for the party beginning to dip. That, in retrospect, proved a blip.

The party leadership has been in flux since the beginning

In a long New Yorker profile that called Petry the “new star of Germany’s far right,” reporter Thomas Meaney observed angry protesters calling her “Adolfina” — directly linking her to Hitler.

Petry is known for giving sharply anti-migrant interviews. She told Newsweek earlier this year, “It’s simply a lie by the government that these migrants will fit into our society.” In the same interview, she also (falsely) blamed refugees for an uptick in criminal activity, told the magazine she was a fan of a closer relationship between Germany and Russia, and argued that it was high time for American troops to leave Germany.

The party, meanwhile, openly continued to question where — and if — Islam fit in Germany.

The head of the Muslim Central Council, Aiman Mazyek, told the New Yorker, “The AfD uses the refugee crisis to foment a propaganda of fear in the minds of its followers. Insults and daily Islamophobia have led to the desecration of houses of worship, and bullying in the streets.”

But while Petry easily critiqued refugees and Islam, she balked when a local AfD politician began to criticize something else as well: Germany’s policy of remembering the past.

It’s long been a taboo in Germany to question Holocaust memorials. The AfD now doesn’t care.

In February, a local AfD politician named Björn Höcke openly complained to a group of young party supporters that "These stupid politics of coming to grips with the past cripple us. We need nothing other than a 180-degree reversal on the politics of remembrance." He then referred to the Memorial to the Murdered Jews of Europe, a sea of concrete stelae in the center of Berlin, as a “a monument of shame in the heart of [the] capital."

At the time, Petry distanced herself from Höcke, and reportedly tried to push him out of the AfD.

But she was also changing her own role in the AfD. She declined to run the election campaign this year, and didn’t run to chair the party in early summer.

That role, instead, went to two relative newcomers — Alice Weidel, an economist, and Alexander Gauland, a septuagenarian former Christian Democrat who proved to be the more radical talking head between the two.

Weidel was a surprise. A lesbian mom of two, whose partner is actually Swiss, Weidel didn’t talk much about her sexuality at first, though she occasionally pointed to it as a sign of her party’s tolerance. And her background seemed more in keeping with liberal, pro-globalization types — she’s lived overseas and speaks Mandarin. But she, too, quickly toed the party line on Islam in German society.

“Headscarves do not belong in public spaces and should be banned on the streets," she said in an interview with the German daily Tagesspiegel.

Gauland took the party’s xenophobia even further.

In August he was widely accused of racism when he attacked the minister of integration, Aydan Özoguz, who was born in Hamburg (her family is from Turkey). In an article, Özoguz questioned what, exactly, was German culture, beyond the language itself. Firing back at her, Gauland said they should school her on German culture and then “dispose of her in Anatolia.”

During the campaign for parliament, the AfD became even more aggressive

When summer rolled around and the campaign for Germany’s federal elections kicked into high gear, the AfD began running overtly misogynistic and Islamophobic advertisements.

One focused on two women, photographed from behind, dressed in skimpy two-piece bathing suits. The tagline reads, “Burkas? We prefer bikinis.”

And once again, the party raised the once-unthinkable question of whether Germany had gone too far in remembering, and apologizing for, the Holocaust.

“We have the right to take back our country and our history," Gauland announced earlier this month, shocking the press. "If the French are rightly proud of their emperor and the Britons of Nelson and Churchill, we have the right to be proud of the achievements of the German soldiers in two world wars,” he added.

It was a radical departure for the political class.

“These are calculated breaches of taboos,” Joerg Forbrig, a fellow with the German Marshall Fund in Berlin, told me last week. “These are provocations. They are designed to sort of propel the AfD time and again into the media and the public debate.”

They were, he pointed out to me, a means of picking up attention by taking a page from Trump’s book: generate heat and get the press to cover it.

But it also shows a new moment in German history. “The past recedes into the past ever more,” Forbrig said. So “there are less and less people who witnessed the Second World War. The theme becomes more abstract.”

In German politics, the third-largest party isn’t a loser

If they were aggressive before, the leaders of the AfD aren’t becoming shy now.

In the wake of the election results, AfD leaders told supporters they planned to “hound Angela Merkel” and open a parliamentary inquiry into her handling of the refugee crisis.

It also seems the xenophobia the AfD ran on had an impact.

But as xenophobia so often works, Brookings’s Stelzenmüller told me, “There was a direct correlation with lack of actual refugees and votes for AfD.” In other words, regions least effected by the refugee crisis voted more heavily for the AfD, some citing refugees as their reason for doing so and others calling their vote for the AfD a protest vote.

From @AliCologne



Left: where most "immigrants" live

Right: where most AfD voters live pic.twitter.com/UK9jXF0TzM — Cas Mudde (@CasMudde) September 26, 2017

“You see a lot of people saying this is the normalization of Germany,” Karen Donfried, the president of the German Marshall Fund in the United States, told me.

“I don't expect there to be a radical change in Germany going forward — Merkel [is] the keeper of continuity, but we have to appreciate that she will be chancellor in a much more complicated political setting,” she said.

One of those complications is the AfD voters, Donfried said. They aren’t going away.

“They want to be heard; they are not happy. Their have concerns about identity and their culture being watered down.”

And on Sunday, almost 6 million of them made that very clear.