Social media companies have been working to remove video of the New Zealand mosque attacks, which were livestreamed by the assailant. But the footage has emerged in a different place in recent days: the election rallies of Turkey’s president, Recep Tayyip Erdogan.

At a televised rally in Antalya, in southern Turkey, on Sunday — and twice the day before — Mr. Erdogan used an edited version of the video to galvanize support among his Islamist followers ahead of local elections at the end of the month and criticize the Turkish opposition as weak.

The attacker, identified as Brenton Tarrant, a 28-year-old Australian, posted a lengthy manifesto before the attacks that said, among other things, that Muslims should be driven out of the part of Turkey that lies west of the Bosporus.

The president played fragments of the video — with blurred images of the attack — at several election rallies and paired them with statements by a Turkish opposition leader to equate his opponent with a notorious Australian senator, Fraser Anning, who blamed Muslim immigration for the attacks.