JAKARTA, INDONESIA - Speaking before thousands in the city that helped raise him, President Obama on Wednesday cited this country's transition from dictatorship to democracy as a model in an Islamic world often governed by unelected autocracies.

He also praised Indonesia - the world's most populous Muslim-majority nation - for a "spirit of tolerance that is written into your constitution, symbolized in your mosques and churches and temples, and embodied in your people," a quality worthy for all the world to emulate.

Obama received a warm welcome from the crowd of about 6,500 at the University of Indonesia, particularly when he spoke in Indonesian, as when he recalled buying satay and bakso from street vendors or referenced the national motto, "Bhinneka Tunggal Ika," or "Unity in Diversity."

"We are two nations which have traveled different paths. Yet our nations show that hundreds of millions who hold different beliefs can be united in freedom under one flag," Obama said.

The speech was cast by White House officials as part of the president's continuing outreach to Muslims, an effort he began last year in Cairo by calling for a "new beginning" between the United States and Islam.

But Muslim views of Obama around the world have worsened in several countries since then, and in the United States, a recent Pew Research Center poll found that nearly one in five Americans thinks the president is a Muslim, in part because of the time he spent here as a child. Obama describes himself as a practicing Christian.

The president's efforts to mend relations with the Islamic world were partly overshadowed by the reopening Tuesday of a rupture between the United States and Israel, a development that reflected his administration's struggle to strike a balance that satisfies either side in the Middle East conflict.

Obama criticized Israel for undermining two-month-old peace talks with new plans to build on land that Palestinians claim as their future capital. At a news conference Tuesday evening, he said of the Israeli government's project to construct 1,300 apartments in East Jerusalem,"This kind of activity is never helpful when it comes to peace negotiations."

Israelis and Palestinians both claim rights to Jerusalem, and Israeli Prime Minister Binyamin Netanyahu responded to Obama by asserting in a statement that "Jerusalem isn't a settlement - Jerusalem is the capital of Israel."

Israel's construction in the occupied eastern part of the city, seized by the Israeli army in the 1967 Middle East war, has infuriated Palestinians, who view the work as a slow erosion of their future state.

Obama and his advisers have, at times, sought to play down his upbringing in Indonesia, but he embraced it on Wednesday during his brief visit.

"Let me begin with a simple statement," he told the audience, which included students, civil activists and others. "Indonesia is a part of me."