An Indonesian court on Tuesday sentenced the minority Christian Governor of Jakarta to two years in prison for blaspheming the Quran at a trial that undermined the country’s reputation for practicing a moderate form of Islam.

The five-judge panel said Governor Basuki “Ahok” Tjahaja Purnama was “convincingly proven guilty of blasphemy” and ordered his arrest. However, Ahok immediately announced he would appeal the guilty verdict and sentence.

The lead judge said the trial was a purely criminal one and the court disagreed that there were political aspects to the case.

The blasphemy accusation against Ahok was a decisive factor in his defeat in last month’s election for Jakarta Governor. Hard-line Islamic groups said it would be a sin for Muslims to vote for a non-Muslim.

The two year prison sentence was a surprise outcome. Prosecutors had recommended a two-year suspended prison sentence.

The maximum sentence for blasphemy in Muslim-majority Indonesia is five years in prison.