On Tuesday, Indonesia's parliament approved a new criminal code banning sex outside of marriage, which carries a punishment of up to one year in jail.
The new code, passed with support from all political parties, also prohibits cohabitation between unmarried couples.
The code will apply to Indonesians and foreigners and comes despite concerns the laws could keep tourists away and harm investment.
It will not go into effect for three years to allow for the drafting of regulations.
The country already bans adultery but had not done the same for premarital sex.
Maulana Yusran, deputy chief of Indonesia's tourism industry board, said the new code was "totally counter-productive" during a time when the country's economy and tourism were beginning to recover from the coronavirus pandemic.
"We deeply regret the government have closed their eyes. We have already expressed our concern to the ministry of tourism about how harmful this law is," he said.
U.S. Ambassador to Indonesia Sung Kim said at an investment summit that the new code could lead to less foreign investment, tourism and travel to the country.
"Criminalising the personal decisions of individuals would loom large within the decision matrix of many companies determining whether to invest in Indonesia," Kim said.
The code is part of several new laws that critics say impose on civil liberties, along with bans on black magic, insulting the president or state institutions, spreading views counter to state ideology and staging protests without notification.
Indonesia's Law and Human Rights Minister Yasonna Laoly responded to criticism of the new law by telling parliament, "It's not easy for a multicultural and multi-ethnic country to make a criminal code that can accommodate all interests."
Reuters contributed to this report.