Updated

Iran's supreme leader told Iraq's prime minister that the U.S. military presence is the main cause of Iraq's problems.

Prime Minister Nouri al-Maliki is in Tehran for three days of meetings, including one Monday with Ayatollah Ali Khamenei.

The meetings have focused on a proposed security agreement between Iraq and the U.S.

On Monday, Khamenei made clear his opposition to the pact.

Iran's state television quoted Khamenei as telling al-Maliki that Iraqis have to "think of a solution to free" themselves from the U.S. military.

Khamenei told him that "a foreign element" will gradually come to dominate all aspects of life in Iraq and become an obstacle to progress and prosperity.

Al-Maliki has been trying to persuade Iranian leaders to back off their fierce opposition to the proposed security agreement. He has promised that Iraq will not be used as a launching pad for any attack on Iran.