(Bloomberg) -- Foreigners in Indonesia should not worry about getting prosecuted for potentially breaching the country’s new criminal code that penalizes sex outside of marriage, a minister said. 

Police will only take action if there is an official complaint made by direct family members such as parents, children or spouses, said Law and Human Rights Minister Yasonna Laoly. 

“So, if people from Australia want to go on a holiday in Bali, and they want to stay in the same room whatsoever, that is their personal matter,” Laoly told reporters on Wednesday. “Unless, there’s a complaint made by their parents in Australia which is not their culture.”

The world’s largest Muslim-majority nation is trying to allay fears among expatriates and tourists after the passage of the new criminal code on Tuesday that critics say could hurt foreign investment and tourism revenue.  

The legislation applies to everyone in the country, including tourists and expatriates, and will only take effect over a three-year transition period.

Deliberation of the bill was held up following days of protests that erupted in 2019 when the draft law was introduced. Critics decried that the new laws infringe on people’s personal lives and curb criticism of the government, a setback for the country’s democracy that could mar its investment climate.

©2022 Bloomberg L.P.