Mahmoud Ahmadinejad has received a warm welcome in Baghdad on the first ever visit to Iraq by an Iranian president.

The visit marks the culmination of a process of normalisation between the two countries after the long war they fought in the 1980s.

Correspondents say the two-day visit is also a strong show of support for the Shia-dominated government in Baghdad.

After talks with the Iraqi president, Mr Ahmadinejad said the visit opened a "new page" in Iran-Iraq relations.

"We have the same understanding of things and the two parties are determined to strengthen their political, economic and cultural co-operation," the Iranian president said in a joint news conference with his Iraqi counterpart, Jalal Talabani.

Is it not funny that those with 160,000 forces in Iraq accuse us of interference

Before leaving for Iraq, Mr Ahmadinejad laughed off the American accusations.

"Is it not funny that those with 160,000 forces in Iraq accuse us of interference?" he asked.

Later, speaking next to Mr Maliki, Mr Ahmadinejad said the US should not blame others for Iraq's problems, and should accept that: "the Iraqi people do not like America."

The US and Iran are also at odds over Iran's nuclear programme. Iran says its programme is for peaceful power generation only but the US and other Western countries fear Tehran is trying to build nuclear weapons.

The UN Security Council is currently considering new sanctions against Iran over the nuclear issue and a vote could take place as soon as Monday.

Complicated relationship

All this puts the Iraqi government nervously in the middle, allied to both the United States and Iran, says the BBC's John Leyne in Tehran.

Despite the reconciliation between Baghdad and Tehran, many analysts believe that in the long term, the two countries are destined to be rivals for regional power.

During the long war between them in the 1980s, many of the prominent Shia now in positions of power in Iraq fled to Iran as Saddam Hussein cracked down on internal dissent.

The US-led overthrow of Saddam's regime allowed them to return from exile.

Trade is now growing between the two countries and tourism, in the form of Iranian pilgrims visiting major Shia shrines in Iraq, is booming.

Further complicating the relationship between the US, Iraq and Iran is the potential of Iran to be a US ally - against al-Qaeda and the Taleban in Afghanistan, says the BBC's Hugh Sykes in Baghdad.

Shia Iran has little in common with the fundamentalist Wahhabists of the Taleban and al-Qaeda, he says.