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.
The Jakarta Post editorial board
was brutal in its assessment of the campaign and what it had meant for Indonesia.
"(This) election campaign ... (has) been the dirtiest, most polarizing and most divisive the nation has ever seen, far worse than that for the 2014 Presidential election," the newspaper's editorial said Wednesday.
Religious divisions in campaign
Ahok was fiercely targeted during the campaign by hard-line Muslim groups, who supported Baswedan.
The governor is on trial over blasphemy charges after an edited version of comments he made at a November rally
went viral on Indonesian social media.
At mass rallies in March, thousands of Jakartans protested against Ahok, calling for him to be removed from power and jailed. Some Muslim voters were told the Quran forbade them from voting for a non-Muslim, such as Ahok, Wilson said.
Losing the election may have been disappointing for Ahok, but he received some good news about his trial soon afterward.
On Thursday, prosecutors announced they were seeking a sentence of two years' probation and one year in prison, which would see him spending no time in jail unless he commits another offense.
They also recommended his charges be refined from blasphemy to "spreading hate."
Still, the verdict and sentence in the blasphemy trial depends largely on the public's mood, said Basuki, the researcher at the think tank.
"If Ahok had won by a large margin, there wouldn't be much danger if (it) charged him with a low sentence, but the election alone will (add) pressure to charge him on a higher count," he said.
Relief in Jakarta
Tensions eased Wednesday night in Jakarta after the election, said Wilson, the Murdoch University research fellow.
"There's relief on all fronts because if Ahok had won, it was very likely there would have been an angry and potentially violent reaction from some (conservative Muslim) groups," Wilson told CNN from the Indonesian capital.
"When I was in the stronghold of the anti-Ahok movement, they were implying they're willing to hit the streets and all the rest of it. Now Anies has won, they're pretty relaxed."
About 65,000 police were deployed in advance of the protests, local media had reported,
highlighting how divisive the campaign had been.