a harsher-than-expected ruling critics fear will embolden hardline Islamist forces to challenge secularism in Indonesia, the world's largest Muslim-majority nation.
Tuesday's guilty verdict for Basuki Tjahaja Purnama comes amid concern about the growing influence of Islamist groups, who organized mass rallies during a tumultuous election campaign that ended with Purnama losing his bid for another term as governor.
President Joko Widodo was an ally of Purnama, an ethnic-Chinese Christian who is popularly known as "Ahok", and the verdict will be a setback for a government that has sought to quell radical groups and soothe investors' concerns that the country's secular values were at risk.
As thousands of supporters and opponents waited outside, the head judge of the Jakarta court, Dwiarso Budi Santiarto, said Purnama was "found to have legitimately and convincingly conducted a criminal act of blasphemy, and because of that we have imposed two years of imprisonment".
Purnama told the court he would appeal.
Charles Santiago, chairman of the ASEAN Parliamentarians for Human Rights (APHR), a grouping of regional lawmakers overseeing rights issues, said: "Indonesia was thought to be a regional leader in terms of democracy and openness. This decision places that position in jeopardy and raises concerns about Indonesia’s future as an open, tolerant, diverse society."
The United Nations' Bangkok Office of the High Commissioner for Human Rights in a tweet said: "We are concerned by jail sentence for Jakarta governor for alleged blasphemy against Islam. We call on Indonesia to review blasphemy law."
Purnama was taken to an East Jakarta prison after the verdict and his lawyer Tommy Sihotang said he would remain there despite his appeal process unless a higher court suspended it.
Shocked and angry supporters, some weeping openly, gathered outside the prison, vowing not to leave the area until he was released, while others expressed their shock on social media.
Some lay down outside the jail blocking traffic, others shook the barbed-wire topped fence of the prison, while some chanted "destroy FPI", referring to the Islamic Defenders Front, a hardline group behind many of the protests against Purnama.
"They sentenced him because they were pressured by the masses. That is unfair," Purnama supporter Andreas Budi said.
But Novel Bamukmin, a leader of the Jakarta chapter of FPI, said the group objected to the sentence "because it was still far from what we had expected."
President Widodo urged all parties to respect the court verdict as well as Purnama's decision to appeal.
Home affairs minister Tjahjo Kumolo said Purnama's deputy would take over in the interim.
Thousands of police were deployed in case clashes broke out, but there was no sign of any violence after the verdict.
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.
Hardline Islamist groups had called for the maximum penalty possible over comments by Purnama that they said were insulting to the Islamic holy book, the Koran.
While on a work trip last year, Purnama said political rivals were deceiving people by using a verse in the Koran to say Muslims should not be led by a non-Muslim.
An incorrectly subtitled video of his comments later went viral, helping spark huge demonstrations that ultimately resulted in him being brought to trial.
RADICAL ISLAMIST GROUPS
Purnama lost his bid for re-election to a Muslim rival, Anies Baswedan, in an April run-off after the most divisive and religiously charged election in recent years. He is due to hand over to Baswedan in October.
If Purnama's appeal fails, he would be prevented from holding public office under Indonesian law because the offense carries a maximum penalty of five years, said Simon Butt of the Centre for Asian and Pacific Law at the University of Sydney.
Song Seng Wun, regional economist at CIMB Private Banking, said that the verdict was "not a huge shock" to investors because most blasphemy cases in Indonesia end in convictions.
"Going forward, race and religion will continue to be played out and be used by politicians for whatever agenda that they have," Song said, adding significant capital outflow was only likely if there was a deterioration of law and order.
Rights groups fear Islamist hardliners are in the ascendancy in a country where most Muslims practise a moderate form of Islam and which is home to sizeable communities of Hindus, Christians, Buddhists, and people who adhere to traditional beliefs.
Andreas Harsono of Human Rights Watch described the verdict as "a huge setback" for Indonesia's record of tolerance and for minorities.
Widodo's government said this week it would take legal steps to disband Hizb ut-Tahrir Indonesia (HTI), a group that seeks to establish an Islamic caliphate, because its activities were creating social tensions and threatening security.