Jakarta, Indonesia (CNN) -- Indonesia and the United States share principles of unity and tolerance and both can benefit from strengthened ties that will bolster trade and combat terrorism, President Obama said in a highly anticipated speech Wednesday.
The address at the University of Indonesia was considered a highlight of Obama's two-day stop in the southeast Asian nation where he spent four years of his childhood.
As the nation with the largest Muslim population in the world, Indonesia was chosen as the site for Obama to further address U.S. relations with the Islamic world following his speech on the topic last year in Cairo, Egypt.
He referred specifically to the Cairo speech of June 2009, noting he called there "for a new beginning between the United States and Muslims around the world -- one that creates a path for us to move beyond our differences."
"I said then, and I will repeat now, that no single speech can eradicate years of mistrust," Obama said. At the same time, he promised that "no matter what setbacks may come, the United States is committed to human progress."
America "is not, and never will be, at war with Islam," Obama insisted. "Instead, all of us must defeat al Qaeda and its affiliates, who have no claim to be leaders of any religion -- certainly not a great world religion like Islam."
Indonesia has been rocked by terror attacks such as bombings on Bali in 2002 and 2005, and Obama noted the nation's progress "in rooting out terrorists and combating violent extremism."
However, Muslims staged rallies across Indonesia on Sunday to protest the American president's visit, and about 20,000 people attended the demonstrations, a spokesman for a protest group said.
"We don't see the differences between Obama and (former U.S. President George W.) Bush. They both oppress Muslims. They both have blood on their hands," said Ismail Yusanto, a spokesman for the Muslim group Hizbut Tahrir. "That's why we reject Obama and we don't believe that he's reaching out to Muslims."
In his speech Wednesday, Obama reflected on his years in Indonesia, referring to how he and his family were warmly accepted. He got cheers when he sprinkled sayings from the local Malay language, such as "Selamat Datang" -- a greeting of welcome -- and the national motto "Bhinneka Tunggal Ika," which means "unity in diversity."
Noting that Malay is one of hundreds of languages of the archipelago nation, Obama lauded Indonesia for its spirit of inclusiveness despite its diverse population and history of dictatorship.
"But even as this land of my youth has changed in so many ways, those things that I learned to love about Indonesia -- that spirit of tolerance that is written into your constitution, symbolized in your mosques and churches and temples standing alongside each other; that spirit that is embodied in your people -- that still lives on," he said.
Now, Obama said, he returned as the U.S. president seeking "a deep and enduring partnership" with Indonesia, "because as vast and diverse countries; as neighbors on either side of the Pacific; and above all as democracies -- the United States and Indonesia are bound together by shared interests and shared values."
"America has a stake in an Indonesia that is growing, with prosperity that is broadly shared among the Indonesian people -- because a rising middle class here means new markets for our goods, just as America is a market for yours," Obama said.
The U.S. leader called for Indonesia's continued development and warned that would require "a refusal to tolerate the corruption that stands in the way of opportunity," along with a commitment to transparency and protecting the freedom being honored on the Heroes' Day holiday Wednesday marking Indonesian independence.
"Our nations show that hundreds of millions who hold different beliefs can be united in freedom under one flag," Obama said. "And we are now building on that shared humanity -- through the young people who will study in each other's schools; through the entrepreneurs forging ties that can lead to prosperity; and through our embrace of fundamental democratic values and human aspirations."
CNN's Tom Cohen contributed to this report.