By Sarah Marsh and Thomas Escritt

BERLIN (Reuters) -The far-right Alternative for Germany (AfD) shrugged off a string of scandals to take second place in Sunday’s EU election, making gains in particular among the young, while Chancellor Olaf Scholz’s Social Democrats scored their worst result ever.

The AfD’s strong showing comes as Germany’s party landscape undergoes its biggest upheaval in decades, with new populist parties vying to take space vacated by the shrinking mainstream parties that have dominated since reunification in 1990.

This looks set to make it much harder for established parties to form workable coalitions after elections in three eastern German states in September and at federal level next year.

The rise of populism is also coarsening the political climate, say analysts. The campaign was overshadowed by a surge in violence against politicians and activists.

The AfD was plagued by scandals in recent months with its lead candidate having to step back from campaigning in May after declaring that the SS, the Nazis’ main paramilitary force, were “not all criminals”.

One of his aides was charged with spying for China and another candidate faced allegations of receiving bribes from a pro-Russian news portal.

The AfD also faced nationwide mass anti-extremism protests and rivalry from a new populist party, the Sahra Wagenknecht Alliance (BSW), that was founded in January and that is also anti-establishment while advocating a more left-wing economic policy.

The eurosceptic party nonetheless won a record 16.2% of the vote on Sunday, according to an exit poll published by state broadcaster ARD at 1958 CET (1758 GMT). That was 5.2 percentage points more than in the last EU election in 2019 and more than all three parties in Scholz’s coalition.

‘BRUSSELS BUREAUCRACY’

The AfD gained ground among younger voters, up 12 percentage points to 17% among 16-24 year olds, tying with the conservatives for most popular party in that age group, and in the former Communist East.

“We’ve done well because people have become more anti-European,” the AfD’s co-leader Alice Weidel said on Sunday,

“People are annoyed by so much bureaucracy from Brussels,” she added, giving a plan ultimately to ban CO2-emitting cars as an example.

The results were in line with an expected broader shift rightwards for the European Parliament across the bloc of 450 million citizens.

The AfD has tapped into frustrations with Scholz’s coalition, support for which has plunged since it took office in late 2021 and immediately had to contend with multiple challenges, ranging from the Ukraine war and rising irregular migration to a cost of living crisis.Just a week before the election, a policeman was stabbed and killed at an anti-Islam rally by an Afghan man who was not living legally in Germany, an incident which shocked Germany and could have boosted the showing for the anti-migration AfD.

Germany’s Greens were the biggest loser on Sunday, falling 8.6 percentage points to 11.9%, according to the ARD exit poll, punished by voters for the cost of policies to reduce CO2 emissions – in line with expectations for environmental parties across Europe.

Scholz’s Social Democrats (SPD) and the third coalition partner, the pro-business Free Democrats (FDP) also fared poorly, expected to win 14% and 5% of the vote respectively, down from 15.8% and 5.4% in the last election.

The conservatives, who are in opposition at federal level, were forecast to come first, rising slightly to 30.2%.

But analysts say next year’s election is still wide open, not least because Friedrich Merz, their likely chancellor candidate, is gaffe-prone and could alienate more centrist voters.

The BSW, which demands an immediate end to weapons deliveries to Ukraine, won 5.8% of the vote in its first major electoral vote, according to the ARD exit poll, tapping into worries about an escalation of the Ukraine war due to western involvement.

(Reporting by Sarah Marsh and Thomas EscrittEditing by Keith Weir)