Mr Maliki (R) is also looking for Iran's economic help
Iraq will not allow its territory to be used to attack Iran, Iraqi Prime Minister Nouri Maliki has said during a visit to Tehran.
Mr Maliki met the foreign minister and President Mahmoud Ahmadinejad, who pledged to help with Iraq's security.
The role of the US in Iraq is high on the agenda, with Tehran concerned about a treaty under discussion on the terms of the US military's future in Iraq.
Iran's alleged backing for militants in Iraq was also expected to be discussed.
'Peace and security'
"We will not allow Iraq to become a platform for harming the security of Iran and neighbours," Iranian state-run media quoted Mr Maliki as saying after late-night talks with Foreign Minister Manouchehr Mottaki.
In his talks with Mr Ahmadinejad, Iranian media quoted Mr Maliki as saying: "A stable Iraq will be a benefit to the security of the region and the world."
The future role of US troops is a key concern for Iran
Mr Ahmadinejad told Mr Maliki: "Iraq's neighbours have more responsibility to help the country to establish peace and security."
Without referring directly to the US-Iraqi deal, Mr Ahmadinejad was quoted as saying: "Iraq must reach a certain level of stability so that its enemies are not able to impose their influence."
A statement from Mr Maliki's office in Baghdad said economic and trade issues were high on the agenda.
"Iraq is looking forward to Iranian companies taking part in developing its infrastructure," Mr Maliki is quoted as saying.
The BBC's John Leyne, in Tehran, says Iran has made no secret of its opposition to the current negotiations going on between Iraq and the US, which are aimed at regulating the presence of US forces in the country after their UN mandate expires at the end of 2008.
The US-Iraqi talks, which are seeking to reach agreement by the end of July, have run into problems over issues related to Iraqi sovereignty.
The Iraqi prime minister was also expected to raise allegations of Iranian support for Shia militants in Iraq.
Shia militiamen fought bitter battles with US and Iraqi government forces between March and May.
Mr Maliki is on his third visit to Iran since taking office in June 2005.
Government sources say Iraqi security officials with the delegation will be showing the Iranians evidence of their alleged support for the militias, the BBC's Jim Muir in Baghdad reports.
Iran has always denied any involvement, but officials say Mr Maliki will once again urge Tehran to support the Baghdad government and stop secretly backing militias.