The US has called on Iran to stop arming militants in Iraq at the first bilateral public talks between the two countries in almost 30 years.
The two countries' ambassadors to Iraq attended the talks
US envoy Ryan Crocker said his Iranian counterpart had rejected the charges at the four-hour talks in Baghdad, which focused exclusively on Iraq's security.
Both countries agreed that a secure and stable Iraq was in their interests.
Iran's ambassador, Hassan Kazemi-Qomi, described the meeting as a success and said there were plans for future talks.
As the talks ended, a car bomb exploded near an important Sunni mosque in the centre of Baghdad, killing at least 20 people and wounding dozens of others.
'Looking for results'
Speaking after the meeting in the Green Zone, Mr Crocker said he had spelt out Washington's concerns about alleged Iranian support for insurgents who have been attacking Iraqi and US-led forces.
He said the arming of the militia groups, allegedly led by the Islamic Revolution Guards Corps' Quds Force, needed to end and that the US would "be looking for results".
The US ambassador to Iraq acknowledged that the Iranians too had made their views clear.
"They made the assertion that the coalition presence was an occupation and that the effort to train and equip the Iraqi security forces had been inadequate to the challenges faced," he said.
Mr Crocker said he had rejected the allegation by making clear that coalition forces were in Iraq at the Iraqi government's request and that the coalition had invested billions of dollars into training and equipping Iraqi forces.
Nevertheless, Mr Crocker said the talks had proceeded "positively" and there had been broad agreement for a "secure, stable, democratic, federal Iraq in control of its own security, at peace with its neighbours".
He also said Washington would consider an Iranian proposal for the setting up of a regular "trilateral security mechanism" incorporating Iraq, Iran and the US to co-ordinate on such matters.
"A point that I made in the meeting is that the purpose of the meeting was not to discuss further meetings - it was to lay out concrete concerns as we did and our expectation that action would be taken on them," he added.
Iran's ambassador said the talks had been promising.
"Generally there was a positive fruit from this round of negotiations," he told reporters. "[They] were an important first step between the two sides."
Mr Kazemi-Qomi reportedly told the Associated Press that the two sides would meet again in Iraq in less than a month, but one of his assistants later said Tehran would have to be consulted and that no date had been set.
Iran criticised the US attempt to create a viable Iraqi security force
Contrary to suggestions in the Iranian press that he would attack US foreign policy in his speech at the talks, Mr Kazemi-Qomi cited a long list of assistance Iran has given Iraq since the fall of Saddam Hussein and made a politely worded comment about the poor performance of the coalition authorities.
Iranian President Mahmoud Ahmadinejad has said the US had sent more than 40 messages to Tehran asking for the meeting in Baghdad.
"I repeatedly asked them to submit a formal request and they eventually did," he told students while on a tour of Isfahan.
Mr Ahmadinejad also said it had been his decision not to broaden the agenda of the talks beyond the security situation in Iraq.
"In their letter they said that they had left the agenda of talks open so that we could negotiate on any other issue, but I gave them a negative response," he said.
There are tensions between Washington and Tehran over a range of issues, including Iran's continuing defiance of international pressure and sanctions over its nuclear programme.
The BBC's Jim Muir in Baghdad says that, given the atmosphere of recrimination currently prevailing between Iran and the US, the remarkable thing is that this meeting took place at all.
Iraq says it hopes the meeting will lead to further dialogue, but the impression is that the Americans will want to see a change in Iranian behaviour before they pursue it much further, our correspondent adds.