Insulting the country's President Joko Widodo is also included, part of a sweeping legal overhaul that critics say undermines civil liberties in the world's third-largest democracy.

The new criminal law was passed in a parliamentary session, during which lawmakers hailed the success of passing a bill that has taken decades to develop.

New legislation "catastrophic"

Indonesia has been working since 2015 on the legislation that now replaces the century-old Dutch colonial laws that existed in the country.

The country's justice and human rights minister supported the new legislation, saying three years ago that it is more in line with how Indonesians live today.

The new criminal code has the support of the Muslim majority that governs the country and where many want to see the country shaped based on a conservative view of Islam.

The human rights organization Human Rights Watch called the draft bill "catastrophic, not only for women and religious and LGBTQ minorities, but for all Indonesians" when it was revealed in 2019.