His defeat Wednesday will likely be seen as a victory for the country's conservative Muslims, who have campaigned strongly against the ethnic Chinese Christian governor
commonly known as Ahok.
Indonesia is the world's most populous Muslim country, with an estimated 263 million people
, about 87% of whom are followers of Islam.
"We should forget the difference. We are all the same," Ahok said Wednesday after early election results indicated he was trailing his opponent, Anies Baswedan, a former Indonesian education and culture minister.
A final official result is unlikely to be known for at least two weeks.
Analysts said Ahok's loss will encourage the use of religion in Indonesian elections as a political tool.
"There will not be any drastic changes to Jakarta, Anies will not apply Sharia law, but now this is a steep learning curve for politicians and political parties at seeing how (effective) religious issues are, even when used against an incumbent who was performing very well," said Tobias Basuki, a researcher at the Center for Strategic and International Studies, an Indonesian think tank.
Earlier Wednesday, Indonesian President Joko Widodo said political differences should not "break our unity."
"We are all brothers and sisters. Whoever is elected, we must accept," he told reporters after voting. The Indonesian leader, a close ally of Ahok's, has been vocal in his support for the governor during the campaign.
It's unclear what impact Ahok's loss will have on Joko in the 2019 presidential election. "In the short term, it's a blow to him, but we'll have to see. So much can change so quickly here," said Ian Wilson, research fellow at Australia's Murdoch University Asia Research Center.