BERLIN — The leader of an anti-immigrant movement that has attracted tens of thousands of supporters and upended political debate in Germany stepped down on Wednesday after he was found to have posted an online image of himself as Adolf Hitler, after weeks of denying any Nazi sympathies.

In the photograph, the leader, Lutz Bachmann, has his dark hair combed straight and severely parted above his right temple and wears a toothbrush mustache, closely resembling Hitler. The image was found on Mr. Bachmann’s Facebook page and appeared on the front page of the mass-circulation newspaper Bild on Wednesday. It soon went viral on social media sites.

The issue is a sensitive one in Germany, and Chancellor Angela Merkel and other high-ranking officials have repeatedly denounced the anti-immigrant movement, widely known by its German acronym Pegida, which stands for Patriotic Europeans Against the Islamization of the West.

The controversy broke out even as the movement called on supporters to turn out on Wednesday in large numbers at an anti-immigration rally in the eastern city of Leipzig. The group, which has largely been confined to Dresden in eastern Germany, has grown a few offshoots, which are increasingly countered by larger marches throughout Germany in support of immigration.