BANDA ACEH, INDONESIA (AFP) - Indonesia's Aceh province will stop whipping criminals in public after a wave of international condemnation of the practice, local officials said on Thursday (April 12).

The conservative region on Sumatra island - the only place in Muslim-majority Indonesia that follows Islamic law - passed a regulation on Thursday that will see criminals flogged only behind prison walls.

It is not clear when the new rule will come into effect.

Public whipping outside Aceh's mosques is common punishment for a slew of offenses, ranging from gambling and drinking alcohol to gay sex.

A hooded figure on a makeshift stage rains down lashes, sometimes as many as a hundred strokes, on the back of a grimacing criminal as large crowds of adults and children jeer and scream abuse.

Rights groups have derided it as cruel and last year President Joko Widodo called for an end to public whippings in Aceh.

"This (law) is to muffle protest... to muffle Islamophobia," Aceh governor Irwandi Yusuf said. "We don't want Islamophobia to interfere with (Indonesia's) foreign affairs."

Around 98 per cent of Aceh's five million residents are Muslims, subject to religious law, including the public whippings which came into practice around 2005.

Two Indonesian Christians were flogged in February for playing an arcade game seen as violating Islamic law.

Related Story Aceh moves to make syariah canings private

Related Story Indonesian Buddhists caned under syariah for first time

Non-Muslims can usually choose whether or not to be punished under religious law and sometimes choose a painful flogging to avoid a lengthy court process and jail term.

Related Story Christian couple publicly caned in Indonesia's Banda Aceh for gambling

Under the new rules, caning with a rattan stick cannot be recorded anymore - crowds often filmed the spectacle on smartphones - and only journalists and adults can witness the punishment inside prisons.

Some locals, however, were not sold on outlawing public whippings.

"If caning is done in prison... we're sure there will be more sharia (Islamic law) violations in Aceh," demonstrator Tuwanku Muhammad said at a small protest against the new legislation in the provincial capital Banda Aceh.

"Even now, there are... violations."