Indonesia's President Joko Widodo has said a scholar linked to the 2002 Bali bombings would only be freed from imprisonment if he pledged loyalty to the state and its secular ideology, after news he would be released unconditionally was met criticism at home and abroad.

The president had declared last week that Abu Bakar Bashir, 81, would be freed on humanitarian grounds, citing his age and poor health.

Yusril Ihza Mahendra, a legal adviser to Widodo. had said the leader would be granted unconditional release.

But in a statement on Tuesday, Widodo said it would be "conditional release", a day after the country's chief security minister said the decision was being reviewed.

"Conditions have to be fulfilled like loyalty to the unitary state of Indonesia, to the Pancasila," Widodo said, referring to the state's secular ideology which includes recognition of one God.

"That is one of the very basic conditions".

Convicts eligible for early release are required to pledge loyalty to the state and its secular ideology, known as Pancasila, and not to repeat their crimes.

But Bashir's lawyers and the president's legal adviser said that Bashir had refused to sign the allegiance pledge. Mahendra said Bashir had told him that his loyalty was only to God and Islam.

Australia urges against leniency

Bashir was convicted under anti-terrorism laws in 2010 for links to fighting training camps and jailed for 15 years.

Although linked to the 2002 Bali bombings that killed more than 200 people from 20 countries, including 88 Australians, the scholar was not convicted in connection with the attacks. He has repeatedly denied involvement.

Australian Prime Minister Scott Morrison, speaking before Widodo set out conditions for Bashir's release, urged Indonesia not to show him leniency.

"We have been very clear about the need to ensure that as part of our joint counterterrorism efforts … that Abu Bakar Bashir would not be in any position or in any way able to influence or incite anything," Morrison told reporters on Monday, adding that Australia would protest if the scholar were released early.

April elections

Widodo has also come under fire at home over the possible release. Critics have accused him of trying to win over religious conservatives before a presidential election set for April 17 in the world's largest Muslim-majority country.

190118050618049

Some members of the ruling coalition, including officials in Widodo's party, fear Bashir's release could alienate moderate Muslim and non-Muslim voters.

"Everyone is asking: 'How can we possibly allow this?'," said an official from Widodo's Democratic Party of Struggle.

"Now it's about how many votes we will lose, not gain."

Most opinion polls have given Widodo a double-digit lead over rival Prabowo Subianto, a retired general who had also contested the presidency in 2014.