A former minister has won the race for Jakarta governor after a divisive campaign that has tested Indonesia's multi-faith society. As BBC Indonesian's Rebecca Henschke in Jakarta reports, it's being viewed as a win for sectarian politics.
Although official results are not out until May, early counts were enough for Anies Baswedan, a Muslim, to give a victory speech as Jakarta's governor-elect.
He then headed to the largest mosque in Indonesia to pray alongside the leader of the controversial vigilante group, the Islamic Defenders Front (FPI).
His opponent Basuki Tjahaja Purnama, known widely as Ahok, and a Christian of Chinese descent, is back in court today to face trial for blasphemy.
During the campaign Anies Baswedan met a number of times with FPI - the group leading the mass protest movement calling for Mr Purnama to be jailed for allegedly insulting Islam. The group's leader Rizieq Shihab, has been jailed twice before for inciting violence.
He told his followers to vote only for a Muslim and mosques connected to his group threatened to refuse funerals to families who didn't obey.
Until now the group's main activities have been raids on those it believes are committing "sin and vice" - prostitutes, alcohol sellers and people selling food during fasting hours in the holy month of Ramadan - but in leading the calls for Mr Purnama to be jailed, the group has raised its political profile and increased its support base.
"The main reason people voted for Anies is because he was from the same faith as them, he was viewed as fighting for Islam," says political scientist Dr Hamdi Muluk from the University of Indonesia.
"People voted for Ahok because of his track record, his image as a clean politician who was not corrupt and that he was a firm leader."
Despite having the world's largest Muslim majority, Indonesia respects six official religions. And its national motto: "Bhinneka Tunggal Ika" means unity in diversity.
Anies Baswedan is a respected academic and a former university rector, who studied in the US under a Fulbright scholarship, and before the campaign he was widely known to be a moderate Muslim.
In his victory speech, he insisted that he is committed to diversity and unity.
"We aim to make Jakarta the most religiously harmonious province in Indonesia," he said. But many analysts believe that could be difficult given the groups that he has aligned himself with during this campaign.
"It was a dirty campaign, it's a campaign based on religion," says Andreas Harsono, a researcher with Human Rights Watch.
"It has hurt many people particularly the minority groups. It's bad news for religious tolerance in Indonesia. He has made many promises to these hardline groups about enforcing so-called Islamic codes of social behaviour in Jakarta."
New Jakarta?
During the campaign Anies Baswedan and his running mate Sandiaga Uno talked about creating Islamic-friendly nightlife, inspired by Dubai, to replace the current scene that they say involves too many drugs and prostitution.
But allaying fears that had been voiced during the bitter campaign Sandiaga Uno told the BBC that they will not enforce elements of Sharia law across Jakarta.
"I believe in the Islamic economic system but we will not enforce Islamic law across Jakarta. That is not something we can do."
While a divided Jakarta tries to come to terms with the results, Mr Purnama is back in court on Thursday fighting to stay out of jail.
He is on trial for insulting Islam when he questioned a Koranic verse that has been used by some conservative clerics in this election to mean Muslims shouldn't vote for a Christian.
Over the last 12 years in Indonesia no one charged with blasphemy has been acquitted and Mr Harsono thinks Mr Purnama will also be jailed.
"This will be a very bad message that the blasphemy law can be easily politicised and easily manipulated in order to send your enemies, anyone you don't like, to prison."
Mr Purnama was widely accepted, even by his critics, to be one of the most effective administrators this sprawling mega-city has ever had.
And before the blasphemy charges he was predicted to win the election by a landslide.
When asked what he has learnt from the campaign he laughed and said: "Watch what you say and don't get angry in public."
He also told his supporters not to worry too much and referred also to God.
"Power is something that God gives and takes away," he said.
"No one can achieve it without God's will. So no one should dwell too much on it. Don't be sad. God always knows best."
But his supporters took to social media to express their disappointment.
"The lessons of popularism are stark: too much power in the hands of ignorance." Another said: "We have fallen in love with a governor we can't have."
One Twitter user, @fuadhn, said Indonesians "can feel what US and British citizens feel now. Welcome populism..."