The ailing radical cleric who inspired the Bali bombers and other extremists in Indonesia is to be released from prison halfway through a 15-year jail term, the country’s president said.

The announcement of Abu Bakar Bashir’s imminent release came during campaigning for a presidential election due in April in which opponents of President Joko Widodo have tried to discredit him as insufficiently Islamic.

“I have considered this decision for a long time, involving the National Police chief and legal experts,” Mr Widodo told reporters. “This release was decided because of humanitarian considerations and also related to his healthcare.”

Royals unveil Bali bombing memorial
A total of 202 people were killed in the Bali atrocity (Steve Parsons/PA)

The 2002 bombings on the popular tourist island of Bali by al Qaida-affiliated Jemaah Islamiyah militants killed 202 people, many of them foreigners including dozens of Australians.

Australia urged Indonesia last March against any leniency towards Bashir when the government was considering house arrest and other forms of clemency.

“Stunned that he is about to be released,” said Jan Laczynski, an Australian who lost five friends in the bombing of the Sari Club and narrowly avoided being at the venue himself.

“Truly devastating news as effectively he gets on with his life whilst everyone else suffers from seeing him walk out of jail,” he said.

Bashir’s lawyer Muhammad Mahendradatta said that Bashir, who was sentenced and imprisoned in 2011, would be released within days.

“We haven’t had the exact date of his release, but because Bashir badly needs serious health care the release will be carried out no later than next week,” he said.

Also due to be released from prison next week is the former governor of Jakarta, a Widodo ally and minority Christian who was toppled by a conservative Islamic movement in 2016 and subsequently sentenced to two years in prison on blasphemy charges.

Mr Mahendradatta said he wanted Bahir’s release to be without any conditions, enabling him to meet supporters and give sermons.

However, another Bashir lawyer who is also an adviser to Mr Widodo, Yusril Ihza Mahendra, told Indonesian TV that the cleric accepted conditions and would do nothing except rest and be close to his family.

Mr Widodo said Mr Mahendra was among the legal experts he sought advice from.

The firebrand cleric was arrested almost immediately after the Bali bombings but prosecutors were unable to prove a string of terrorism-related allegations. He was instead sentenced to 18 months in prison for immigration violations.

In 2011, he was sentenced to 15 years in prison for supporting a military-style training camp for Islamic militants.

The 2002 bombings were a turning point in Indonesia’s battle against violent extremists, making heavy security a norm in big cities and forging closer counter-terrorism cooperation with the US and Australia.