U.N. human rights chief Zeid Ra'ad al-Hussein warned the Indonesian government Wednesday against criminalizing its LGBT citizens.

Zeid said "extremist views" expressed by mainstream politicians are "deeply worrying" as the parliament considers revising criminal laws that would outlaw all sex outside marriage and criminalize the country's LGBT minority.

During the past couple of years, the LGBT community has been subject to an escalating campaign of arrests, raids, vile rhetoric from officials and vigilante attacks.

Zeid said if Indonesia, the world's most populous Muslim country, expects others to fight Islamophobia, then Indonesia must be ready to end discrimination toward others.

"The hateful rhetoric against this community that is being cultivated seemingly for cynical political purposes will only deepen their suffering and create unnecessary divisions," Zeid said on the last day of his three-day visit to the Southeast Asian country.

Local news outlets reported Wednesday that President Joko "Jokowi" Widodo cited the country's culture in telling Zeid that LGBT people are not tolerated in Indonesia. Jokowi also reportedly vowed his government would not "over criminalize" LGBT Indonesians.

Rights groups and legal observers believe Islamic and secular political parties are exploiting anti-gay sentiment to reinforce their conservative credentials before provincial elections this year and presidential and parliamentary elections in 2019.