Waving German flag, far-right and anti-Islam groups rally together before vote

Co-lead AFD candidates Alexander Gauland and Alice Weidel attend a news conference in Berlin, Germany September 18, 2017. REUTERS/Axel Schmidt

By Oliver Ellrodt and Stefan Remter DRESDEN, Germany (Reuters) - In the shadows of a Dresden church, hundreds of Alternative for Germany party members rallied with anti-Islam activists, counting down the days to a vote set to make the AfD the first far-right group in parliament in more than half a century. Supporters of both movements stood side by side waving Germany's black, red and gold flag - a public demonstration of the fellow feeling between AfD and hardline PEGIDA, though they are officially separate groups. Outside the city's towering Frauenkirche - destroyed by Allied bombing in World War Two, then rebuilt after reunification - supporters stood by a huge blue banner that urged people to vote for the AfD on Sept. 24. One supporter held an AfD poster bearing the slogan: "Get your country back". The AfD could become the third largest party with up to 12 percent of the vote, polls show, built on its calls for Germany to shut its borders to immigrants and stop refugees bringing in their families. The party rejects its mainstream rivals' efforts to compare it to the Nazis. Some AfD members have also been keen to keep their distance from PEGIDA - full name the Patriotic Europeans Against the Islamisation of the West. But PEGIDA founder Lutz Bachmann told supporters to cast their ballots for the AfD on Monday night. "Both votes should go to what is currently the only alternative for Germany, which also bears this name, the Alternative for Germany (AfD). Together, we can make it," Bachmann said. In Germany voters cast two ballots in a mixed-member proportional voting system - the first directly for a candidate in his or her constituency and the second for a party. The second vote determines the distribution of seats in parliament. PEGIDA has been meeting in Dresden regularly for almost three years and at its peak in early 2015 drew crowds of around 25,000 but has since largely disappeared from the headlines as its support base has dwindled. Alexander Gauland, one of the AfD's top candidates, told a news conference that Islam was a political doctrine and did not belong to Germany. The 76-year-old was widely criticized for saying Germans should be proud of what their soldiers achieved during World War One and Two. One of the officers he named was Claus von Stauffenberg, who led an unsuccessful attempt to assassinate Hitler in July 1944 with a bomb in a briefcase. Von Stauffenberg's grandson wrote an article for newspaper Die Welt saying he was outraged by Gauland's comments and his grandfather and other leading figures of German culture would be proud of immigration and diversity in Germany's history. On Monday Gauland said recent estimates showed 95 percent of German soldiers were not involved in war crimes and their families wanted to be proud of their sacrifices. "This has nothing to do with the crimes committed by the leaders. I addressed the individual performance of German soldiers in two world wars. I reiterate that," he added. Alice Weidel, the AfD's other top candidate, said the arrival of more than a million migrants over the last two years had made Germany "a safe haven for criminals and terrorists". Weidel, who is openly lesbian, also said that perpetrators of attacks against homosexuals were "always the same," namely "people with Muslim backgrounds, Arabs". (Writing by Michelle Martin; Editing by Andrew Heavens)