(CNN) Indonesian President Joko Widodo has postponed a vote that could have criminalized consensual extramarital sex after outcry from human rights groups worldwide.

The vote would have been on a new penal code , which the government agreed on last week. The code was set to pass into law on Tuesday, with lawmakers describing the vote as a formality. The code would also have effectively outlawed same-sex relations and made it a criminal offense to insult the president.

In a televised address on Friday, Widodo said he decided to postpone the vote after "seriously considering feedback from different parties who feel objections on some substantial content of the criminal code."

"There are some contents that need an in-depth study," he said. "In that case, I ordered (the) Law and Human Rights minister to deliver my standpoint to Parliament. I also ordered Law and Human Rights Minister to gather feedback from the public again as an input for a better criminal code."

News of the code drew international criticism, with Human Rights Watch describing the draft code as "disastrous not only for women and religious and gender minorities, but for all Indonesians."

Read More