Indonesian president Joko Widodo lashed out at politicians for stoking a huge protest that briefly turned violent on Friday night as a hardcore group pressed for the resignation of Jakarta’s governor, a Christian accused of insulting the Qur’an.

The first ethnic Chinese politician to lead this sprawling city of 10 million people, Basuki Tjahja Purnama is standing for re-election in February, competing with two Muslim candidates for the job.

The governorship of the capital is a powerful position and was a stepping stone for Joko Widodo to the presidency two years ago.

At a news conference in the early hours of Saturday, Widodo called for calm and took a swipe at politicians – whom he didn’t name – for whipping up demonstrators after most had already gone home.

“We deplore the incident after the Isha prayers, when should have already disbanded but became violent. And, we see this was steered by political actors who were exploiting the situation,” Widodo said.

During the protest police fired tear gas and water cannon to subdue the crowd that authorities said swelled to about 150,000 after Friday prayers as they congregated around the presidential palace.

Some protesters threw rocks at the police, two vehicles were torched and a fire broke out near the city’s national monument, but by the evening the demonstration was fizzling out.

However, in a northern neighbourhood of the city there was a late-night clash between police and a few dozen protesters, and social media reports showed a convenience store being looted.

Hundreds camped out until around four in the morning beside the parliament building, demanding Purnama be charged with blasphemy.

A police spokesman said one person died and 12 were hurt. Local media said about 23 people were arrested, most of them in the north, where overnight police guarded shopping and residential areas that are home to predominantly non-Muslims.

About a dozen Muslim groups have accused Purnama of insulting Islam after he said his opponents had used a verse from the Qur’an to deceive voters. The verse implies that Muslims should not choose non-Muslims as leaders.

Chanting “God is greatest”, many in Friday’s protest waved placards calling for Purnama, popularly known as Ahok, to be jailed for blasphemy. A white banner hung at an overpass was painted with red letters that read “Hang Ahok here”.

Police are investigating the case against Purnama, who has apologised for his remarks, insisting he was not criticising the Qur’anic verse but those who used it to attack him.

Purnama has a reputation as a no-nonsense reformer with little patience for the corruption widely blamed for the chaos and dilapidated infrastructure in an overcrowded city.

He remains popular despite efforts by Muslim groups to vilify him and is seen as the frontrunner in the election, though many voters are angry with him for evicting large numbers from slums to modernise Jakarta.

Widodo, a Muslim, has vowed not to interfere in any legal proceedings against Purnama, according to media reports. But he said at his news conference that any legal process involving Purnama would be executed “swiftly, firmly and transparently”.

Indonesia is the world’s most populous Muslim country, but protests on such a large scale are rare. Ethnic Chinese make up just over one per cent of the country’s 250 million people, and they typically do not enter politics.

Indonesian Chinese have faced persecution and violence in the past, especially during the political and social turmoil that gripped Jakarta when former president Suharto was toppled.

On Saturday Widodo cancelled a planned three-day visit to Australia, citing the security situation in Jakarta.