Iran's supreme leader Ayatollah Ali Khamenei has told Iraqi Prime Minister Nouri al-Maliki that the presence of the U.S. military is Iraq's main problem.

Iranian state media report the two leaders met Monday in Tehran as part of Mr. Maliki's visit to Iran, his third since he became prime minister.

The Iranian reports quote the ayatollah as saying he is certain the Iraqi people will get through these difficult times and that the American dreams for Iraq will not materialize.

U.S. and Iraqi officials are negotiating a security deal that would allow American forces to remain in Iraq beyond December 31, when their U.N. mandate expires.

Media reports in the region suggest the U.S. is seeking to establish permanent bases in Iraq. U.S. officials have denied those reports.

Iran opposes the security deal. On Sunday, Mr. Maliki assured Iranian Foreign Minister Manouchehr Mottaki that any U.S.-Iraq security agreement will not harm Iran.

Mr. Maliki also met with Iranian President Mahmoud Ahmadinejad, who called for expansion of ties between the neighboring countries.

Iran's state news agency (IRNA) quoted President Ahmadinejad as saying stronger relations between the two nations will help Iraq's development and stability.

The United States has accused Iran of arming, funding and training Shi'ite militias in Iraq, a charge Tehran denies.

Some information for this report was provided by AFP, AP and Reuters.