BAGHDAD — Iranian President Mahmoud Ahmadinejad finished his landmark visit Monday to Iraq with a swagger, insisting that U.S. power is irrelevant in the region and affecting the role of big brother to Baghdad's Shiite-led government.

The two-day trip offered powerful political theater on Iran's growing ties with its former enemy — with U.S. officials getting a front row seat.

It also coincided with two suicide car bombs Monday in different parts of Baghdad. At least 24 people were killed and dozens were wounded, police said.

Neither of the attacks took place in the areas of the sprawling city where Ahmadinejad was visiting.

While here, Ahmadinejad took every opportunity to show off how much the two countries' ties have changed since the 2003 U.S.-led invasion toppled Iran's former arch-nemesis Saddam Hussein.

Iraqi officials laid out red carpets and military bands played for the hardline president — the first Iranian leader to visit Iraq. In front of live TV crews, Ahmadinejad held hands and exchanged kisses on the cheek with Iraqi President Jalal Talabani, who fondly told him to call him "Uncle Jalal."

Ahmadinejad repeatedly referred to Iraq as a "brotherly" neighbor and predicted that his visit would open a new chapter between Baghdad and Tehran.

The visit was mostly symbolic but Ahmadinejad's message to the U.S., Iraq and its Arab neighbors was bold: Iran has cemented its role as the new power player here.

'They have turned a page'"Iraq and Iran having been deadly enemies, and this shows they have turned a page," said Rand Corp. analyst and former diplomat James Dobbins.

Though both Iraq and Iran have Shiite majorities, they were hostile to each other throughout Saddam's long reign. About 1 million people died in the eight-year war that ensued after Saddam invaded Iran in 1980.

But when Saddam's Sunni-dominated regime fell after the U.S.-led invasion and Iraq's Shiite majority took power, the Shiite elite in Iran had a chance to extend their reach.

Ahmadinejad didn't shy way from sharply criticizing the United States. He blamed America for spreading terrorism in the region, demanded the U.S. go home and dismissed allegations that Tehran is training Shiite militants who target U.S. troops.

"The presence of foreigners in the region has been to the detriment of the nations of the region," Ahmadinejad said during a news conference Monday. "It is nothing but a humiliation to the regional nations."

Bush 'stealth visits' ridiculedHe even took a swipe at U.S. President Bush for making secret visits to the country he invaded.

Unlike Bush's trips to Iraq, Ahmadinejad announced his journey in advance, drove in a motorcade down Baghdad's airport road — once known as "The Highway of Death" — spent the night and even traveled to a Shiite holy shrine in northern Baghdad, albeit under the cover of night.

"The visits should be declared and open. And all those who come on stealth visits, we should ask them why they visit this country in a stealth manner?" Ahmadinejad said.

Despite the beefed up Iraqi security in some parts of Baghdad for Ahmadinejad's visit, at least 24 people were reportedly killed in two suicide car bomb explosions in different parts of the city, police said, though the U.S. military reported 11 people had died in the attacks.

The U.S. presence in Baghdad is massive, with military helicopters and drones frequently zipping through the skies, but the Iranian president had no contact with the Americans during his stay. The U.S. military did not provide security for him.

The closest he got was whisking through the U.S.-controlled Green Zone — the heart of America's presence in Iraq — to visit Prime Minister Nouri al-Maliki at his Cabinet offices.

But the entire visit appeared to be a bold message to the U.S. and its Arab allies in the Mideast that Iran was the new heavyweight here.

U.S. officials have tried to brush aside Ahmadinejad's visit, and the White House on Monday disputed Ahmadinejad's dismissal that Iran was not aiding terrorists.

"Nice words for him to say in the middle of Baghdad, but the facts on the ground prove otherwise," Gordon Johndroe, a spokesman for Bush's National Security Council, told reporters traveling with Bush back to Washington.

Despite the friendly atmosphere between Ahmadinejad and Iraqi officials, it remained unclear what specific, long-term effects Ahmadinejad's visit would have on curbing the violence and bringing stability to Iran's neighbor.

Talabani, who speaks Farsi, and al-Maliki, who spent time in Iran under Saddam, may now have a more direct pipeline to Tehran to pressure it into playing a greater role in ending the conflict among Iraq's rival Shiite groups and stemming the violence in Iraq.

But it was unclear just how strong Iran's influence is among the powerful Shiite factions.

Iran has appeared to cut political ties to radical Shiite cleric Muqtada al-Sadr and thrown its full backing behind his rival, the Supreme Iraqi Islamic Council of Abdul-Aziz al-Hakim, the country's most powerful Shiite political insider. Ahmadinejad met with al-Hakim during his visit.

While the U.S. military has said the flow of Iranian weapons into Iraq has slowed, it has stepped up its accusations that Iran is backing so-called "special groups," the term the U.S. uses for Shiite factions that have broken away from al-Sadr and are responsible for a flurry of deadly rocket attacks recently.

Richard Russell, who teaches national security at the National Defense University, said he'd be suspicious of the Iranians' motives.

Iran's agenda includes establishing "a clandestine infrastructure in Iraq," and Tehran is "planning to have more influence domestically inside Iraq as Americans downsize their presence," he said.

Video: Better ties
But some Iraqis — both Sunnis and Shiites — say it is precisely that influence and power struggle between the U.S. and Iran that worries them.

About 1,000 protesters in a Sunni-dominated neighborhood in Baghdad protested his visit Monday, a day after scattered demonstrations greeted his arrival. "Your mortars preceded your visit," one placard read.

"We do not want our country to pay the price of the current U.S.-Iraq disputes. The Iraqis' decisions should be independent and not tied to any other country," said Sheik Salah al-Obeidi, a spokesman for al-Sadr in the Iraqi holy city of Najaf.

Copyright 2008 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.