An Indonesian court on Tuesday sentenced Jakarta's Christian governor Basuki Tjahaja Purnama to two years in prison for blasphemy over remarks he made about the Qu'ran.
Judges also ordered that Purnama, who had been free while seeking re-election, be detained immediately.
"The defendant's action has caused unrest in society and wounded the feelings of Muslims," the presiding judge said.
Purnama said on Tuesday that he would appeal the decision.
Prosecutors had originally requested a one-year jail term, suspended for two years.
Security was tight around a government building that had been converted into a makeshift courtroom in South Jakarta, with armed police on standby to guard against trouble involving opposing crowds.
Purnama lost a re-election bid in last month's gubernatorial election to a Muslim candidate, Anies Baswedan.
During an official function in September, Purnama told local residents that his opponents had "lied" to them by saying the Qu'ran prohibited them from voting for a non-Muslim governor.
A video of his speech became available online and led to hundreds of thousands of Muslims demanding his prosecution during rallies in October, November and December.
Purnama's election rival Baswedan was backed by conservative Muslims who wanted incumbent Purnama jailed for the perceived insult to Islam.
Once the clear favourite for a second term, Purnama saw his poll numbers fall after the blasphemy accusations. Support for the US-educated Baswedan rose after he met one of the leaders of the anti-Purnama protests, firebrand cleric Muhammad Rizieq Shihab.
Purnama, the first Christian to lead Jakarta in 50 years, is seen by supporters as an effective administrator in a bureaucracy long plagued by corruption and incompetence.
