Basuki "Ahok" Tjahaja Purnama was accused of insulting the Quran after he questioned his opponents' use of a verse against his role as a governor. Purnama apologised later, saying he meant no offence.
An Indonesian court has found Jakarta's governor Basuki Tjahaja Purnama guilty of blasphemy against Islam and sentenced him to two years in jail.
The court found Purnama guilty of having "legitimately and convincingly conducted a criminal act of blasphemy, and because of that we have imposed two years of imprisonment," head judge Dwiarso Budi Santiarto said.
Purnama told the court he would appeal the ruling.
The sentence against the ethnic-Chinese Christian governor, known as "Ahok", was harsher than expected. Prosecutors had called for a suspended one-year jail sentence on charges of hate speech. The maximum sentence is four years in prison for hate speech and five years for blasphemy.
Prosecutors had called for a suspended one-year jail sentence. Purnama's opponents believed that was too light. Hundreds of members of conservative Muslim groups gathered outside the south Jakarta courtroom amid a heavy security presence ahead of the ruling, calling for Purnama to be given the maximum penalty possible.
The trial has been widely seen as a test of religious tolerance in the world's largest Muslim-majority nation.
TRT World's Arabella Munro reports.
The government has been criticised for not doing enough to protect religious minorities among Indonesia's 260 million population of whom almost 90 percent profess adherence to Islam.
President Joko Widodo, a key ally of Purnama's, has urged restraint over the trial and called for all sides to respect the legal process.
Thousands of police have been deployed in the capital because of tension between Purnama's supporters and opponents.
"Both groups will have the opportunity to demonstrate, but we are taking steps to prevent clashes," said national police spokesman Setyo Wasisto.
Purnama lost his bid for re-election as governor in an April run-off – after the most divisive and religiously charged campaign in recent years – to a Muslim rival, Anies Baswedan. He will hand over to Baswedan in October.
"Ahok will be jailed because he insulted religion," read one of many anti-Purnama posts on the Facebook account of the Islamic Defenders Front (FPI), a conservative group instrumental in organising mass protests against Purnama.
"Balloons and flowers will be useless," the post added, referring to a recent outpouring of sympathy from supporters of the embattled governor after he lost the April election.
His supporters delivered thousands of red and white balloons to City Hall ahead of Tuesday's court session.
Purnama has denied wrongdoing, though he apologised for comments he made last year criticising his opponents' use of the Quran in political campaigning.
The tensions whipped up during the Jakarta election have raised concerns about the rising influence of extreme groups in Indonesia, which is home to sizeable communities of Buddhists, Hindus, Christians and people who adhere to traditional beliefs.
The government said on Monday it would take legal steps to disband Hizbut Tahrir Indonesia (HTI), a group that seeks to establish an Islamic caliphate, because its activities were creating social tensions and threatening security.