At the end of a 10-day family holiday, Obama spoke to a packed crowd in the capital Jakarta, where he praised the spirit of tolerance in Indonesia, saying you could see mosques, temple and churches alongside each other.
"That spirit is one of the defining things about Indonesia, the most important characteristics to set as an example for other Muslim countries around the world," Obama said.
The 44th president of the United State then said: "Bhinneka Tunggal Ika," -- Indonesia's motto, which means unity in diversity, prompting huge cheers from the crowd of thousands of leaders, business people and students at the Fourth Congress of Indonesian Diaspora.
Obama lived in Indonesia when he was a six-year-old boy with his mother, an anthropologist, and his Indonesian stepfather and half-sister.
His mother later divorced and Obama moved back to Hawaii at the age of 10 to live with his grandparents.
The Muslim-majority country has recently seen a rise in Islamic radicalism.
Its track record as a tolerant nation is being tested after former Jakarta governor Basuki Tjahaja Purnama -- an ethnic Chinese Christian -- lost Jakarta's mayoral election in April against a prominent Muslim candidate.
Purnama was later sentenced to two years prison in May for blasphemy over comments he made about the Koran which divided the nation and stirred up issues of religion and ethnicity in the archipelago, which was long hailed by other countries for it's ability to tolerate different religious.
Prior to Jakarta, Obama and his family visited the resort island of Bali and the ancient city of Yogyakarta which is known for its temples.
The Obamas will leave Indonesia for South Korea on Sunday.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)