Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

MAINZ, Germany — Voters in Berlin — once the epicenter of Adolf Hitler's dark Nazi regime — were given an unusually strong warning from the city's mayor in the run-up to recent local elections.

Michael Mueller, a member of the center-left Social Democrats, warned that double-digit gains for the right-wing AfD party would be interpreted worldwide as a "return of the right and the Nazis in Germany.”

The warning had little effect.

Days later, Mueller and the political establishment were left stunned when the Alternative for Germany (AfD) party took 14 percent of the vote.

Charlotte Knobloch, the former head of Germany’s Jewish community and a Holocaust survivor, was among the voices calling on Germany’s mainstream parties to prevent a “brown renaissance.”

The success of a party that "disgustingly stirs up hatred against minorities," makes Nazi terminology and thesis “socially acceptable” and “cannot credibly distance itself from neo-Nazis and Holocaust deniers, is a ... nightmare," she warned.

While the AfD has been celebrating election gains — it is on the verge of becoming Germany's third-strongest political force, according to recent polls — it has been battling the label of an extremist party over its anti-Islam stance and a number of controversies surrounding some of its members.

Last week, it came under renewed criticism for providing a home to politicians who support far-right ideologies.

Kay Nerstheimer, an AfD candidate for Berlin’s state parliament, reportedly called Syrian refugees “disgusting worms” on his Facebook page and was once a member of the far-right German Defense League. Meanwhile, magazine Stern reported that local AfD politician Rudolf Mueller had been selling banned Nazi paraphernalia at his antique shop in the state of Saarland.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: German Anti-Immigrant Party Beats Merkel's Party in Home State

AfD officials were quick to deny far-right tendencies, saying the organization is based on democratic values and insisting it was not "a right-wing populist party.”

“Every party, especially young ones, attract odd birds, troublemakers and fools,” AfD spokesman Ronald Glaeser told NBC News, arguing that his organization needed to mobilize its “self-cleaning powers” as it grew.

The party, founded in February 2013, initially appealed to anti-European Union voters but began to focus on anti-migrant policies when started to record strong gains when Germany’s “welcoming culture” saw the arrival of more than 1.1 million refugees.

Berlin's mayor Michael Mueller worries about the rise of the AfD. TOBIAS SCHWARZ / AFP - Getty Images

As Germans saw what seemed to be an unremitting influx of migrants and rising costs from Angela Merkel's open-door policy, “a strong dissatisfaction and mistrust grew among many voters towards the political establishment," said professor Werner Patzelt, a political scientist at the Technical University in Dresden.

Under its slogan “courage for the truth,” the AfD has been able to mobilize disaffected non-voters, swing voters and people who “no longer feel represented by the long-established parties in Germany,” Patzelt explained.

Merkel's Christian Democrats have neglected to integrate right-wing conservatives into their party, leaving many voters "politically homeless,” Patzelt said.

AfD spokesman Glaeser said failed policies were to blame for the situation, arguing that “politicians who ignore the will of the public majority will have to expect resistance.”

Analysts believe this public backlash has echoes in a growing number of western countries — including the United States.

“Trump is an expression of frustration, of being left alone, which is widespread in society,” Norbert Roettgen, head of the Foreign Council in Germany's parliament, told public broadcaster ZDF after Monday's first Clinton-Trump debate.

“Cheap propaganda, creating fear, that is a western phenomenon,” said Roettgen, who belongs to Merkel’s party. “Trump carries it to the extremes, but we also see this in Europe, in Germany,” Roettgen added.

Move to the Right Comes at a Cost: Experts

Meanwhile, German officials are warning that a rightward shift in society bares strong economic risks, alienating potential investors and new businesses, especially in the East.

The historic city of Dresden has already experienced an economic set-back, blamed partly on massive anti-Islam and anti-foreigner PEGIDA demonstrations that have shaken the baroque tourist destination. According to CNBC, domestic visitor numbers were down 3.7 percent year on year in the period of January to July 2016, based on overnight stays in the city.

“The xenophobic remarks and incidents damaged the good reputation of the city and especially impacted domestic travel behavior,” Bettina Bunge, head of Dresden Marketing, DMG, said in a statement.

To counter the “PEGIDA effect” and other factors, such as fears of terrorism, her office launched a campaign aimed at overcoming cultural and social bias.

Dresden will have an opportunity to present itself in a more positive and colorful light, when it hosts this year’s celebration of German unification under the motto “Building Bridges” from October 1-3.

But PEGIDA and the AfD will also be in the streets for rallies marking German "unification day," October 3.