It coincides with the final day of campaigning for Wednesday's vote in the capital of the world's most populous Muslim-majority country, where ethnic Chinese Christian governor Basuki Tjahaja Purnama is facing two prominent Muslim challengers.
The mass prayer, centered at the Istiqlal Mosque, encouraged people to cast their ballots for Muslim leaders.
Supporters and followers of several Islamic groups, including from the Islamic Defenders Front and the Muslims Forum, joined the mass movement, flashing posters such as "I'd prefer if my leader is a Muslim" and "It is forbidden to pick an infidel leader".
But he has seen a once unassailable poll lead whittled away after being hauled into court for a blasphemy trial that critics view as unfair and politically motivated.
The protest movement against him, which has been spearheaded by Islamic hardliners, and the court case have sparked concerns about growing religious intolerance in a country long considered a bastion of pluralism.
Undeterred by heavy rain, more than 100,000 people showed up, national police spokesman Rikwanto, who goes by one name, said.