In what was the first address given to the Turkish parliament by a US president since Bill Clinton in 1996, Obama said: "Let me say this as clearly as I can: the United States is not, and will never be, at war with Islam ... if we are joined together in delivering that message East and West, to the world, I think we can have an extraordinary impact.
"Let me say this as clearly as I can: the United States is not, and will never be, at war with Islam"
"America's relationship with the Muslim world cannot and will not be based on opposition to al-Qaeda.
"We seek broad engagement based upon mutual interests and mutual respect," he said, adding that he was committed to renewing the alliance and friendship "between our people".
Al Jazeera's Anita McNaught, reporting from Istanbul, said the highly anticipated address hit all the right notes and reached out to many.
Asked about his position on the issue of the killing of Armenians in the Ottoman empire in 1915 - a sensitive issue which has poisoned ties between the two allies before – Obama tried to strike a balance.
|Obama called for a greater partnership with the Muslim world [Reuters]
"My views are on the record and I have not changed those views. What I have been very encouraged by is news that under President Gul's leadership you are seeing a series of negotiations, a process in place between Armenia and Turkey to resolve a whole host of long-standing issues including this one," Obama said.
"I want to be as encouraging as possible around those negotiations which could bear fruit very quickly, very soon."
Obama has previously backed moves to call the killings "genocide" in the US, but did not mention the sensitive word in Turkey on Monday.
Turkey accepts that many Christian Armenians were killed by Ottoman Turks during the first world war but denies that up to 1.5 million people died as a result.
US officials later said Obama had met the foreign ministers of Turkey and Armenia "to commend their efforts toward Turkish-Armenian normalisation and to urge them to complete an agreement".
"By co-operating with Turkey, the US can achieve what it intends to do in the Middle East easier and better"
AK party member
Obama praised Turkey for pursuing "difficult political reforms" and pressed it to open borders with Armenia.
"[Open borders] would provide for a peaceful and prosperous coexistence" that would serve both countries, he said.
Al Jazeera's McNaught explained that the Armenia issue had been a major source of anxiety for Turkey during Obama's trip, and the US president agreed not to make any public attempts to get involved in relations between Turkey and Armenia.
Yaser Yakis, a member of Turkey's ruling AK party and a former foreign minister, told Al Jazeera: "Turkey has every reason to be satisfied with Obama's visit and the message he gave to the Turkish public and to the Islamic world from Ankara.
"We got the impression that he listened to what President Gul told him. Regarding the Iraq question, Turkey expects more advanced co-operation in fighting PKK terrorism."
By co-operating with Turkey, Yakis said, "the US can achieve what it intends to do in the Middle East, easier and better ... Turkey can play a role as far as soft power is concerned, to be in good terms with both Israelis and Arabs and this is an advantage because we have a better understanding of the mentality in the Middle East".
Earlier in the day, Obama and Gul discussed a number of issues of mutual national concern, including the threat of nuclear proliferation.
Obama regretted that relations between Turkey and the US had been defined by military and national security terms for far too long.
Obama pledged continued co-operation with Gul in building on "what is really a strong foundation" with Turkey.
|There were protests across the country preceding Obama's visit [AFP]
He will wrap up his visit in Turkey by meeting religious leaders, touring historical sites and holding a round-table meeting with university students.
He was also scheduled to attend a reception of the Alliance of Civilisations, a forum which aims to foster dialogue between the West and the Muslim world.
The Turkish authorities have taken unprecedented security measures in view of Obama's visit, blocking a street leading to the hotel where he is staying and deploying aircraft to patrol Ankara's skies.
But the security measures could not prevent huge protests preceding Obama's visit across many Turkish cities.
Protesters said he was seeking to press Turkey to deploy troops in Afghanistan in an effort to control the situation there.