ISTANBUL - U.S. President Barack Obama ended his trip to Muslim Turkey on Tuesday by calling for peace and dialogue with Islam and the creation of a Palestinian state living side by side with Israel.

In his first trip as president to the Muslim world, Obama sought to rebuild ties after anger at the invasion of Iraq, the war in Afghanistan and accusations his predecessor George W. Bush was biased in favor of Israel.

I came to Turkey because I am deeply committed to rebuilding a relationship between the United States and the people of the Muslim world, one that is grounded in mutual interest and mutual respect, Obama said.

I believe we can have a dialogue that is open, honest, vibrant...And I want you to know that I am personally committed to a new chapter of American engagement, he said at a meeting with Turkish youngsters.

Obama's visit, in which he said America will never be at war with Islam, marks a strong shift in U.S. policy after his predecessor Bush upset Muslims with his backing for Israel, invasion of Iraq and branding of Iran as part of an axis of evil.

Obama will now need to flesh out, through policies, his promises to engage the Muslim world.

Amr El-Choubaki, an Egyptian political analyst with the Al-Ahram Center for Political and Strategic Studies, said Obama differed fundamentally from Bush's world view and lacked his high-handedness toward Arabs and Muslims.

He pleased Muslims with his call to push aggressively for a two-state solution for Israelis and Palestinians, in a challenge to the new Israeli government of right-winger Benjamin Netanyahu.

I believe that peace in the Middle East is possible. I think it will be based on two states side by side, a Palestinian state and a Jewish state, Obama said.

I think in order to achieve that, both sides are going to have to make compromises. I think we have a sense of what those compromises should be and will be. Now what we need is political will and courage on the part of leadership.

HOPE AND CHANGE

Meeting with the youth symbolizes the expectation of hope and change, because the previous administration had a problem with its image in the Muslim world, said Salih Altundere, 23, studying international relations at Bogazici University.

Obama rejected critics who said his speech in Prague on nuclear disarmament, his calls for Middle East peace and engagement with Iran were too idealistic.

My attitude is that all these things are hard. I am not naive. If it would be easy it would already be done, he said.

Moving the ship of state is a slow process. States are like big tankers. They are not like speedboats. You can't just whip them around and go in a new direction. Instead, you slowly move it and eventually you end up in a very different place.

He admitted America had made mistakes.

When it comes to Iraq, I opposed the war in Iraq. I thought it was a bad idea. Now that we're there, I have the responsibility to make sure that, as we bring troops out, that we do so in a careful enough way that you don't see a complete collapse into violence, Obama said.

Respecting Muslim sensitivity, he said he would like to wrap up the youth meeting before the call to prayer.