BAGHDAD, Iraq (CNN) -- Iranian President Mahmoud Ahmadinejad, heading home after a two-day visit to Iraq, again touted his country's closer relations with Iraq and reiterated his criticism of the United States.

"No one likes them," Ahmadinejad told reporters prior to returning to Iran, referring to the predominantly U.S. makeup of coalition forces in Iraq.

"We believe that the forces which crossed oceans and thousands of kilometers to come to this region should leave this region and hand over the affairs to the peoples and government of this region," Ahmadinejad said.

His visit follows trips to Iran last year by top officials of Iraq's Shiite-led government, which has been fostering a closer relationship with predominantly Shiite Iran since the Saddam Hussein regime was toppled by U.S.-led forces in 2003.

His visit was greeted warmly by Iraq's Shiite Muslim leaders, whose links to Iran predate the overthrow of Hussein.

Ahmadinejad met with Iraqi President Jalal Talabani, Prime Minister Nuri al-Maliki, other politicians, clerics, tribal leaders and academics.

At the same time, many Sunni Muslims in Iraq who dislike the Iranian regime demonstrated against his visit. Watch as Iraqis protest the visit »

In a news briefing on Monday, Ahmadinejad said the two countries, which fought an eight-year war in the 1980s, had signed memorandums of understanding, such as economic and border agreements, and would sign many more.

On Sunday, Ahmadinejad announced plans to link Iran's electrical grid with neighboring Iraq. The two countries have already signed a deal to construct cross-border pipelines. Read more about power supply deal

The Iranian president made digs at the United States. He contrasted his trip, which was advertised in advance, with the "stealth" visits of others, a reference to visits by U.S. officials who sometimes do not broadcast their visits to Iraq for security reasons.

Sunday's official welcome and meeting with Talabani took place at the presidential house outside the heavily fortified Green Zone.

And his early Monday visit to the Imam Moussa al-Kadhim shrine in Kadhimiya, the Shiite district in northwestern Baghdad, served to underscore his point that he could move more openly and with confidence around Baghdad.

He repeated his criticism of the U.S. position that Iran was backing violence in Iraq. The United States has accused Iran of supporting insurgent groups in Iraq, including supplying explosively formed penetrators, the deadliest and most sophisticated type of roadside bomb. Watch U.S. Lt. Gen. Raymond Odierno comment on Iraq-Iran relations »

"We do not care about their statements and remarks because they make statements based on erroneous information. We cannot count on what they say," Ahmadinejad said.

He said coalition forces "shouldn't interfere in the affairs of regional countries" and "should allow the region's countries to run their own affairs."

In Washington, U.S. State Department Deputy Spokesman Tom Casey said the United States supported Iraq's efforts to conduct its "diplomatic relations the way it sees fit.

"These are two countries that are going to have to have relations with one another," he said, referring to Iraq and Iran.

Casey said there were no indications that "Iran is willing to modify its behavior." But he said Washington hopes that the relationship presents an "opportunity for the Iranians to explain and perhaps take real action to deal with some of the problems we have pointed out in the way they manage their relationship."

After Ahmadinejad left Iraq, Talabani's office issued a 14-point joint statement from Talabani and Ahmadinejad that underscored the importance of "good neighborliness and non-interference" and the need to improve ties and resolve disagreements.

It called for strengthening cooperation in gas and oil development and widening commercial cooperation. Iraq thanked Iran for a $1 billion loan to support Iraq's economy and rebuild its infrastructure. Iran emphasized its support for Iraq's efforts to forge national unity.

Ahmadinejad's visit coincided with that of Adm. Michael Mullen, chairman of the Joint Chiefs of Staff.

On Sunday, in northern Iraq, he walked openly on the streets of Hawaija, a former al Qaeda in Iraq bastion now described in a Pentagon news release as "a market crowded with people and shops stocked with goods." E-mail to a friend

All About Iran • Iraq