ISTANBUL (AFP) - US President Barack Obama on Tuesday pledged a new chapter of American engagement as he wound up a visit to mainly Muslim Turkey with messages of US reconciliation with the Islamic world. On the final day of his maiden trip to a Muslim country, Obama visited a landmark mosque in Istanbul as well as met religious leaders and university students to push his appeal for dialogue. Simple exchanges can break down walls between us, he told the students in a session that saw him answer questions on US policy. I am committed to a new chapter of American engagement... We cant afford to talk past one another, to focus only on our differences or to let the walls of mistrust go around us. He also called for a balanced approach towards Israel, saying the Jewish state was not behind all problems in the Middle East. In the Muslim world, the notion that somehow everything is the fault of the Israelis lacks balance because there are two sides to every question, Obama said. The US President sent a similar message to Israel, saying you have to see the perspective of the Palestinians. He voiced renewed hope that the Israeli-Palestinian conflict could be resolved on the basis of a two-state solution. Meanwhile, US President Obama said on a surprise visit to Iraq on Tuesday that the next 18 months could be critical, and told the war-torn country that it would soon have to look after itself. He told Iraqs Prime Minister Nuri al-Maliki on Tuesday that it was essential that Iraqi factions be represented in the government and security forces. Its absolutely critical that all Iraqis are integrated into the government and security forces, Obama said, alluding to the Sahwa fighters who were commissioned to help the United States fight Al-Qaeda in Iraq. Obama, who has called for an end to US combat operations in Iraq by August next year, also pledged he would stick to a timetable for all American troops to leave the country by the end of 2011.It is time for us to transfer (control) to the Iraqis, Obama told an audience of US troops soon after he flew in to Baghdad aboard Air Force One on his first trip since taking office three months ago. They need to take responsibility for their country, he said, noting that the next 18 months could be critical for the nation invaded by a US-led coalition in March 2003. Obama was immediately rushed off to meet General Ray Odierno, the top US army commander in Iraq at the start of his short trip, and met Prime Minister Nuri al-Maliki at a US airbase outside Baghdad. You have given Iraq the opportunity to stand on its own as a democratic country. That is an extraordinary achievement, and for that you have the thanks of the American people, Obama told the troops. As well as the planned US withdrawal, Obama and Odierno talked about diplomatic and political challenges, the need to build strong Iraqi institutions and the importance of future general elections. Obama met Maliki at the US base Camp Victory, where he promised that he would pull American troops out of the country as planned, the Iraqi premiers office said. The US president also met his Iraqi counterpart Jalal Talabani.