Former U.S. President Barack Obama urged Indonesians on Saturday to resist divisive politics based on race and religion, saying the world’s most populous Muslim nation has a long history of tolerance that should be preserved.

Indonesia’s reputation for pluralism has come under scrutiny since Jakarta Governor Basuki Tjahaja Purnama, an ethnic-Chinese Christian, was sentenced in May to two years in prison for blasphemy in a trial that came after Islamist-led rallies.

Obama, who was on a personal visit to the country where he spent some of his childhood, said the Muslim community in Indonesia had historically protected Hindu and Buddhist temples.

“Indonesia is made of thousands of islands, hundreds of languages, scores of regions and ethnic groups. So my time here made me cherish and respect for people’s differences,” he told a packed audience in Jakarta.

Obama stopped short of mentioning any specific cases of racial or religious intolerance.

“It is very important here in Indonesia, the United States, Europe, everywhere, to fight against the politics of ‘us and them’,” he said to cheers from thousands of mostly Indonesians who have worked or studied abroad.

He arrived in Jakarta after visiting the cultural city of Yogyakarta and white-water rafting on the tourist island of Bali. He also met Indonesian President Joko Widodo in Bogor, south of the capital.

Indonesia, a country of 250 million people, has experienced rising intolerance against non-Muslims and the lesbian, gay, bisexual and transgender community.

A leader of Indonesia’s second-largest Muslim organization this week called for a boycott of Starbucks, saying that the international coffee chain’s pro-gay stand risks ruining the “religious and cultured” core of the country.