An Indonesian court has found Jakarta's outgoing Christian governor guilty of blasphemy against Islam.

Basuki Tjahaja Purnama, also known as Ahok, was sentenced to two years in prison on Tuesday in a south Jakarta courtroom over comments he made regarding what he believed to be the misinterpretation of certain verses of the Quran.

As hundreds of protesters gathered outside calling for the maximum penalty to be given, Dwiarso Budi Santiarto, the presiding judge, told the court that Purnama was "convincingly guilty of committing blasphemy".

Purnama has denied wrongdoing, though he apologised for comments he made last year criticising his opponents' use of the Quran in political campaigning suggesting to Muslim constituents that they cannot be governed by a person of another faith.

Purnama lost his bid for re-election in an April runoff - after the most divisive and religiously charged election in recent years - to a Muslim rival, Anies Baswedan.

Thousands of police were deployed in Jakarta on Tuesday in case clashes broke out between Purnama's supporters and opponents who are demanding he be dismissed and jailed.

His supporters, for their part, delivered thousands of red and white balloons to City Hall in advance of the court session.

"Both groups will have the opportunity to demonstrate, but we are taking steps to prevent clashes," said Setyo Wasisto, the national police spokesman.

Prosecutors had called for a suspended one-year jail sentence for Purnama on charges of hate speech.

His opponents believe that is too light. The maximum sentence is four years in prison.

The Indonesian government has been criticised by rights groups for not doing enough to protect religious minorities.

However, President Joko Widodo, an ally of Purnama, has urged restraint over the trial and called for all sides to respect the legal process.

Al Jazeera's Step Vaessen, reporting from Jakarta on Sunday, said critics of Purnama celebrated outside the court after the sentencing, which has been harsher than expected.

OPINION: Islam and politics - Indonesia's identity crisis

"Of course, a lot of people in Indonesia are going to question this verdict," she said.

"They are going to wonder what kind of precedent this will set for other cases, how easy it will be to [bring] blasphemy charges against other opponents, especially if they happen to be from a minority in the country."

She said Purnama was likely to be detained immediately, adding that the verdict perhaps makes it harder for religious minorities to run for office in the future.

"It will make it difficult to hold speeches," Al Jazeera's Vaessen said.

"People will have to be more careful over the wording they use, because apparently it's quite easy to run the risk of being accused and getting a verdict of blasphemy now."