Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

JAKARTA, Indonesia — The minority Christian governor of Jakarta was sentenced to two years in prison on Tuesday for blaspheming the Quran, a jarring ruling that undermines the reputation of the world's largest Muslim nation for practicing a moderate form of Islam.

In announcing its decision, the five-judge panel said Gov. Basuki "Ahok" Tjahaja Purnama was "convincingly proven guilty of blasphemy" and ordered his arrest.

Jakarta Governor Basuki "Ahok" Tjahaja Purnama, center, talks to his lawyers after his sentencing hearing on Tuesday. Bay Ismoyo / AP

Photos quickly appeared online of Ahok, who still commands immense popularity in Jakarta being warmly greeted by prison staff. Ahok said he would appeal, but it was unclear if he would be released once that process is underway.

By early evening, hundreds of angry supporters had gathered at the high-security prison, some pushing hard against a tall metal gate and others setting a tire alight. "Brothers and sisters, justice has died in this country," said a man addressing the crowd with a megaphone.

The accusation of blasphemy engulfed Ahok in September after a video surfaced of him telling voters they were being deceived if they believed a specific verse in the Quran prohibited Muslims from voting for a non-Muslim leader.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

An incorrectly subtitled video of his comments later went viral, helping spark huge demonstrations that ultimately resulted in him being bought to trial.

Massive street protests in the past six months against Ahok and Tuesday's verdict are among the signs of an increasing religious conservatism in Indonesia. In Western capitals, Indonesia has traditionally been seen as a bulwark of tolerance and pluralism in the Islamic world. Vigilante groups frequently attempt with impunity to prevent Indonesia's religious minorities from practicing their faiths, and the country's gay community has faced a surge in persecution in the past two years.

Andreas Harsono of Human Rights Watch described the verdict as "a huge setback" for Indonesia's record of tolerance and for minorities.

He added: "If someone like Ahok, the governor of the capital, backed by the country's largest political party, ally of the president, can be jailed on groundless accusations, what will others do?"

A police officer stands guard during a protest by supporters of Jakarta Gov. Basuki Tjahaja Purnama, who is popularly known as "Ahok," outside Cipinang Prison following his conviction of blasphemy on Tuesday. DARREN WHITESIDE / Reuters

The blasphemy case was a decisive factor in Ahok's defeat to a Muslim candidate in last month's election for Jakarta governor. Hard-line Islamic groups opposed to having a non-Muslim leader for the city capitalized on the trial to draw hundreds of thousands to anti-Ahok protests in Jakarta that shook the centrist government of President Joko "Jokowi" Widodo.

"Hard-liners will feel emboldened by the ruling, given that the trial represents a wider tussle between pluralism and Islamism in Indonesia," said Hugo Brennan, an analyst at Verisk Maplecroft, a political risk assessment firm in Singapore.

Outside the court, Syamsu Hilal, a member of a hard-line Muslim group who reported Ahok to police last year, said justice had been upheld.

"Here we have witnessed that the judge has become a representative of God," he said.

Muslim protesters shout slogans during a protest outside the court where Jakarta's Christian Gov. Basuki "Ahok" Tjahaja Purnama was convicted on Tuesday. Achmad Ibrahim / AP

But Ahok supporter Adrian Sianturi said the trial was a victory for intolerance and corruption.

"This decision is the character assassination of a good governor, a clean politician who is rare in this country," he said.

The two-year prison sentence was a surprise outcome after prosecutors had recommended two years of probation. The maximum sentence for blasphemy in Indonesia is five years in prison.