As the clock ticks down to elections Sunday, Germany's cyber defence nervously hopes it'll be third time lucky after Russia was accused of meddling in the US and French votes.

But even if Berlin avoids a last-minute bombshell of leaks or online sabotage, it sees Moscow's hand in fanning fears of Muslim migrants that are driving the rise of the hard-right.

Forecasters say Chancellor Angela Merkel is almost certain to win.

But she will also face, for the first time in German post-war history, a right-wing populist and anti-immigration party will have its own group on the opposition benches.

The Alternative for Germany (AfD) -- which calls Merkel a "traitor" for her 2015 welcome to refugees -- has been promoted especially in internet echo chambers by far-right trolls and ultra-nationalists.

While mainstream media have treated the AfD with distaste, the most positive coverage has appeared in Kremlin-funded media such as RT and Sputnik, which have also heavily focussed on migrant crime.

The London School of Economics (LSE) found that "official Russian media and unofficial pro-Russian trolls offer constant and repetitive support for the AfD and its anti-immigrant message," wrote journalist Anne Applebaum, a participant in the monitoring project.

The AfD, meanwhile, has been actively courting the 2.5 million-strong Russian-German community with neighbourhood stands, flyer campaigns and a Russian-language YouTube channel.

Especially elderly and poor Russian-Germans have been receptive to xenophobic and anti-Muslim messages amid the 2015 mass migrant influx, said Berlin community leader Alexander Reiser.

"The fear was stoked by Russian TV, which presented it as a catastrophe, of Europe being flooded by migrants," he said, pointing also to Russians' "traumatic memories" of the Soviet collapse and Russia's wars against Islamic fundamentalists.

- Sowing doubt, discord -

The risk of Moscow attempting to use Russian-Germans as pawns moved into the spotlight with the 2016 case of "Our Lisa".

Russian media spread the story -- quickly debunked by German police -- of three Muslim men who raped a 13-year-old Russian-German girl, and of a subsequent cover-up by police and politicians.

It sparked Russian-German street protests that escalated into a top-level diplomatic dispute between Berlin and Moscow.

Many Russian-Germans believed the conspiracy tale because they "projected their Russia experience onto the case," said Reiser, who estimated that 15-20 percent remain "stuck in a totalitarian way of thinking and will never fully understand democracy".

A top-level government official told AFP the Lisa case was Berlin's "wake-up call" on Russian propaganda.

Other fake news stories followed, including one claiming German NATO soldiers in Lithuania raped a young girl.

Berlin's biggest fear, however, has focussed on a massive 2015 malware attack that crippled the Bundestag parliamentary network for days.

It netted 17 gigabytes of data which, officials feared, could be used to blackmail MPs or discredit them, possibly on new "BTLeaks" websites.

German security chiefs said "smoking gun" proof was impossible but blamed the hacker group known as Fancy Bear or APT28, which has been linked to Russia's GRU military intelligence and accused of attacks on Hillary Clinton's 2016 presidential campaign.

IT security experts sprang into action by drilling MPs and sensitising the public about the risk of online mischief, meme wars and other disinformation designed to sow doubt and discord and delegitimise the democratic process.

Security agencies BND and BfV warned of Russian influence operations, the IT security agency BSI started war-gaming attacks, and the military launched a Cyber Command while musing about the option of "hack-back" counterstrikes.

- Patriotic hackers -

The Brookings Institution's Constanze Stelzenmueller told a US Senate committee in June that "for a Russia that is clearly bent on destabilising Europe and the transatlantic alliance, Germany is the prize".

Russian President Vladimir Putin has denied Moscow seeks to influence foreign elections but said that "patriotic hackers" are beyond Moscow's control.

Weeks after Trump's election, Merkel consulted experts about fake news and the bot algorithms that make them go viral.

Story continues