An Indonesian court has sentenced the minority Christian governor of Jakarta to two years in prison for blaspheming the Koran at a trial that undermined the country's reputation for practicing a moderate form of Islam.

In a tense trial that was widely seen as a test of religious tolerance in the world's largest Muslim-majority nation, Basuki Tjahaja Purnama, also known as Ahok, was "found to have 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 told the court.

Ahok was charged with blasphemy after he said clerics had used a Koranic verse to mislead voters by telling them that Muslims were not allowed to vote for a Christian.

'Huge setback' for tolerance and minorities

Andreas Harsono of Human Rights Watch said the guilty verdict against Ahok was "a huge setback" for Indonesia's record of tolerance and for minorities.

"This is bad news for Indonesian minorities," he said.

"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?"

The tensions whipped up during the Jakarta election have raised concerns about the rising influence of Islamist groups in Indonesia, which is home to sizeable communities of Buddhists, Hindus, Christians and people who adhere to traditional beliefs.