Iran's supreme leader Ayatollah Ali Khameni told visiting Iraqi Prime Minister Nouri al-Maliki in talks Wednesday that the way to end instability in Iraq was for US forces to withdraw, Iran's state-run television reported. Al-Maliki was making his first visit to Iran since he came to office in May, looking to a close ally of his Shi'ite-led government for help in calming the violence tearing apart Iraq and in developing Iraq's troubled oil industry. In the latest sign of increasing cooperation, the two countries have reached a deal for developing joint oil fields that straddle their borders, and eventually Iraq will send crude to refineries in Iran for processing, Iraq's Oil Ministry said Wednesday. The deals and al-Maliki's visit reflect the steadily strengthening ties between the US-backed Iraqi government and Iran, a bitter enemy of the United States. Al-Maliki's reception has been a warm one in Iran, where he spent part of his years-long exile from Iraq during Saddam Hussein's rule. Khamenei - who holds the final word in all political matters in Iran - said Iran considers it an "obligation" to support Iraq's post-Saddam government. However, Khamenei made clear that Iran wants to see US troops leave Iraq. "Part of (Iraq's) sufferings have been due to the actions of the former regime, and part is due to the presence of occupiers in Iraq," Khamenei told al-Maliki, according to the Iranian state news agency. "We hope a day will come when the Iraqi people reach the stage they deserve and that, by cutting the hands of the foreigners, its wealth will come to serve the Iraqi people," Khamenei said.