Iraqi Prime Minister Nouri al-Maliki's talks with Iranian leaders during his three-day visit here have focused on the proposed security agreement that Iran fears will keep the American military in neighboring Iraq for years.
Al-Maliki has tried to push Iranian leaders to back off their fierce opposition to the proposed pact, promising that Iraq will not be a launching pad for any attack on Iran.
But the agreement has become a point of contention as Baghdad tries to balance its close ties to rivals Washington and Tehran.
Iran, which has repeatedly said the way to end instability in Iraq is for U.S. forces to withdraw, believes the proposed pact could lead to permanent U.S bases on its doorstep amid fears of an eventual American attack.
"Occupiers who interfere in Iraq's affairs through their military and security might ... are the main problems," Iran's state television quoted Ayatollah Ali Khamenei as saying Monday.
Khamenei said Iraqis have to "think of a solution to free" themselves from the U.S. military. Though he did not explicitly mention the security agreement, he said Iraqis - not Americans - must decide the fate of their country.
"That a foreign element gradually interferes in all Iraqi affairs and expands its domination on all aspects of life is the main obstacle in the way of progress and prosperity of the Iraqi nation," the TV quoted Khamenei as saying.
Khamenei, who has the final say in Iran over government decisions, said the U.S. will fail to achieve its goals in Iraq.
"We are certain that the Iraqi people, through unity and effort, will get past these difficult conditions. For sure, America's dream for Iraq will not come true," Khamenei was quoted as telling al-Maliki.
Al-Maliki's visit to Tehran, his second this year, appeared aimed at getting Iran to tone down its opposition and ease criticism within Iraq. Followers of anti-U.S. Shiite cleric Muqtada al-Sadr - who has close ties to Tehran - have held weekly protests in Iraq against the deal.
The proposed security pact also faces strong criticism from members of al-Maliki's own Shiite-dominated coalition.
Two Iraqi officials familiar with the negotiations warned on Sunday that a deal is unlikely to be reached before the end of President Bush's term in January unless Washington backs off some demands seen as giving American forces too much freedom to operate in Iraq and infringing on Iraqi sovereignty. The officials spoke on condition of anonymity because of the secrecy surrounding the negotiations.
Though both Iraq and Iran are Shiite-majority countries, the two were hostile to each other throughout Saddam Hussein's regime. Their eight-year war after Saddam invaded Iran in 1980 cost about 1 million lives.
But when Saddam's Sunni-dominated regime fell and Iraq's Shiite majority took power after the 2003 U.S.-led invasion, long-standing ties between the Shiites of both countries improved, though the two neighbors have yet to sign a peace treaty.