Iranian President Hassan Rouhani arrived in Baghdad on Monday, as Iraqi legislators face mounting pressure to limit political and economic ties with its neighbour.
The trip, described as “historic and noble” by Iran’s Foreign Minister Mohammad Javad Zarif, will strengthen ties between the neighbouring states.
It will also send a strong message to US President Donald Trump and regional allies that Tehran still dominates Baghdad, observers say.
It is the first official visit by Mr Rouhani since he became president in 2013.
"We want to be united with Iraq, standing side by side," he said, standing alongside Iraqi President Barham Salih.
A secure and stable Iraq will benefit the region, Mr Rouhani said, adding that Iran did not "want to stand against others".
Mr Salih said that Iraq's geographical location made it crucial to resolve regional issues.
The visit will mark the third trip to Iraq by an Iranian president since the 1979 Islamic Revolution. Former President Mahmoud Ahmadinejad visited in 2008 and 2013.
Iran has close but complicated relations with Baghdad.
“We have important projects that will be discussed,” Mr Rouhani said.
These relations could not be compared to Baghdad’s ties “with an aggressor country like America”, he said.
“America is despised in the region. The bombs that the Americans dropped on Iraqis, Syrian people and other countries cannot be forgotten.
“Iran-Iraq relations are very special. We are very much interested in expanding our ties with Iraq, particular our transport co-operation,” Mr Rouhani said later.
“Whenever the people of the region had a problem and asked Iran for help, the people and government of Iran rushed to their help with all their power."
Although Tehran does not have an official military presence in Iraq, the government supports powerful Shiite paramilitary groups operating in the country, with estimates of up to 150,000 fighters.
Mr Rouhani also met Prime Minister Adel Abdul Mehdi. During his three-day visit he will meet with other politicians and Shiite leaders.
He is also expected to hold talks with the country’s chief Shiite cleric Grand Ayatollah Ali Sistani, who is also revered by many Iranians.
The meeting in the city of Najaf will be the first between the top cleric and an Iranian president.
In 2013, the Grand Ayatollah refused to receive Mr Rouhani’s controversial predecessor Mr Ahmadinejad.
During the past three months, Iranian officials have visited Iraq, including Mr Zarif, the Minister of Oil, Bijan Zanganeh, and Energy Minister Reza Ardakanian, to discuss business opportunities.
Mr Zarif arrived in Baghdad on Sunday ahead of Mr Rouhani.
The Iranian president is facing pressure from hardliners at home after Mr Trump pulled out of the nuclear deal with Tehran.
Washington is pushing Iraq to limit its relations with Iran, especially after it reimposed economic sanctions on Tehran.
But Iraq has taken a firm stance against the embargo and said it would “stand by Iran”.
Mr Zarif thanked Baghdad for having “refused the unjust and illegal sanctions imposed on the Iranian people”.
Washington granted a 90-day waiver for Iraq to continue paying for electricity imports from Iran, despite imposing harsh sanctions on Tehran last November.
The US has been working with Iraq to end its dependence on Iranian natural gas and to increase its energy independence.
Tehran is Baghdad’s second largest source of imported goods.
Besides canned food and cars, Baghdad also buys 1,300 megawatts of electricity and 28 million cubic metres of natural gas daily from Iran to feed power plants.
Mr Rouhani's visit also indicates how relations between the two states have changed.
They fought a long war from 1980 to 1988, but Tehran's influence expanded after the 2003 US-led invasion that toppled former dictator Saddam Hussein.