Iran's supreme leader on Tuesday blamed the United States for the chaos in Iraq and demanded the withdrawal of foreign forces, but also pledged his country's help in quelling the violence.

In a meeting with Iraqi President Jalal Talabani, Ayatollah Ali Khamenei accused the United States of hiring terrorists and former members of Saddam Hussein's regime to destabilize Iraq, according to a state television report.

"The first step to resolve the instability in Iraq is the withdrawal of occupiers from this country and the transfer of security responsibilities to the popular Iraqi government," Khamenei was quoted as saying.

Visit FOXNews.com's Iraq Center for more in-depth coverage.

His comments came hours before the U.N. Security Council voted unanimously to extend for one year the mandate of the 160,000-strong force in Iraq.

Talabani arrived in Tehran on Monday for two days of talks with government officials to seek their support in quelling Iraq's violence. Iran, a Shiite Muslim country, is known to have considerable influence among Iraq's Shiite majority — elements of which have been blamed for the bulk of the recent attacks.

Talabani's meeting with Khamenei came a day before President Bush was due to discuss the Iraqi conflict with Iraqi Prime Minister Nouri al-Maliki in Jordan.

The Iraqi president was invited to Tehran by his Iranian counterpart, Mahmoud Ahmadinejad, who wants to enhance Iran's role in Iraq as a counter to U.S. influence in the Gulf region.

In his meeting with Talabani, Khamenei said Iran considered it a "religious and humanitarian" duty to work for peace in Iraq.

"If asked by the Iraqi government, Iran won't spare any effort to contribute to stability and security in Iraq," Khamenei said.

"The main reason for the current situation in Iraq is America's policies," he added.

"Those (the Americans) who plotted against Iraq, and whose plans have not materialized, are intent on destabilizing the situation. Their agents on the ground are terrorists, the excommunicated and former Baathists," he said.

By "excommunicated," Khamenei appeared to be referring to the civil servants loyal to Saddam Hussein's Baath Party whom the U.S. authorities expelled from the government in the early days of its occupation of Iraq.

Khamenei predicted the United States would fail in Iraq, saying "the occupation of Iraq is not a morsel that the U.S. can swallow."

After his arrival in Tehran on Monday, Talabani said his government was in dire need of Iran's help to quell the escalating violence in Iraq.

His host, President Ahmadinejad, pledged to provide help.

"Definitely, the Iranian government and nation will stand next to its brother Iraq and will do every help it can to strengthen security in Iraq," Ahmadinejad said Monday.

Talabani's media advisor, Hiwa Osman, told The Associated Press that the talks between the two leaders were "going very well" and had secured an Iranian commitment to boost Iraqi security.

The Iranians have declared that "they are quite ready for complete cooperation with the Iraqi government to restore security and stability in Iraq," Osman said in a telephone interview from Tehran. He did not elaborate on how Iran would take part in curbing the violence.

Iran wanted to organize a summit bringing together Ahmadinejad, Talabani and Syrian President Bashar Assad, but Damascus did not publicly respond to Tehran's invitation.

The United States has accused Iran of supplying money, weapons components and training to Shiite militia in neighboring Iraq.

Iran has denied the charge, saying it has only political and religious links with Iraqi Shiites.

In recent weeks, the Bush administration has come under increasing domestic and international pressure to engage with Iran and Syria to curtail the violence before Iraq breaks out into a full-scale civil war.

Talabani, who speaks fluent Farsi, is on his fourth visit to Iran since taking office as president. He is a member of Iraq's Kurdish minority, but he had close ties with Iranian officials before Saddam Hussein was overthrown by the U.S.-led invasion in 2003.

Complete coverage is available in FOXNews.com's Iraq Center.