The governor, Basuki Tjahaja Purnama, known as Ahok, is an ethnic Chinese Indonesian and the first Christian in nearly 50 years to govern Jakarta, capital of the world’s most populous Muslim-majority nation.

He has been a political target of some Islamic organizations since taking office in 2014. Some of those groups seized on comments he made in September to a group of fishermen, in which he lightheartedly cited a Quran verse that warns against taking Christians and Jews as friends.

Analysts said that Friday’s march and other recent protests against Mr. Basuki were, nevertheless, attempts to weaken him ahead of the election. Analysts have also said that some of the Islamic groups that organized the march have ties to the campaigns of Mr. Basuki’s two opponents, though the groups and the campaigns have denied that. His opponents are Anies Baswedan, a former minister of higher education, and Agus Harimurti Yudhoyono, a former Army officer and the son of Susilo Bambang Yudhoyono, who was president from 2004 to 2014.

“Precisely because religion and ethnicity are as such not electoral factors, Ahok’s opponents have to up the game,” said Marcus Mietzner, an associate professor at the Australian National University in Canberra, who closely follows Indonesian politics. “Instead of claiming that Ahok shouldn’t be governor because he’s a Christian — which hasn’t worked — they try to portray him as a blasphemist who violated the law.”