"Let me be clear: the United States strongly supports the goal of two states, Israel and Palestine, living side by side in peace and security," he said in a speech to Turkey's parliament.
Chief Palestinian peace negotiator Saeb Erekat welcomed Obama's words, saying he had made a major commitment to the two-state solution. Israeli Prime Minister Benjamin Netanyahu's office said Israel was committed to reach peace and would cooperate with the Obama administration to achieve that goal.
He is trying to rebuild ties with Muslims after anger at the invasion of Iraq and war in Afghanistan, made more urgent by a resurgent al Qaeda and Taliban insurgency in Afghanistan.
"Let me say this as clearly as I can: the United States is not at war with Islam. In fact, our partnership with the Muslim world is critical in rolling back a fringe ideology that people of all faiths reject," Obama said.
"But I also want to be clear that America's relationship with the Muslim world cannot and will not be based on opposition to al Qaeda. Far from it. We seek broad engagement based upon mutual interests and mutual respect. We will listen carefully, bridge misunderstanding, and seek common ground."
"The United States has been enriched by Muslim Americans. Many other Americans have Muslims in their family, or have lived in a Muslim-majority country I know, because I am one of them," Obama said in his speech to parliament.