Updated

Iran agreed Sunday to join the U.S. and other countries at a conference on Iraq this week, raising hopes the government in Tehran would help stabilize its violent neighbor and stem the flow of guns and bombs over the border.

In an apparent effort to drive home that point, Prime Minister Nouri al-Maliki told an Iranian envoy that the persistent violence in Iraq — some of it carried out by the Shiite militias Iran is accused of arming — could spill over into neighboring countries, including those that are "supposed to support the Iraqi government."

Iraq's other neighbors as well as Egypt, Bahrain and representatives of the five permanent U.N. Security Council members have agreed to attend the meeting Thursday and Friday in the Egyptian resort of Sharm El-Sheik.

The conference will also include Secretary of State Condoleezza Rice, raising the possibility of a rare direct encounter between high-level U.S. and Iranian officials. (More)

In Washington, Rice would not rule out a meeting with the Iranians, whose delegation will be led by Foreign Minister Manouchehr Mottaki.

"But what do we need to do? It's quite obvious. Stop the flow of arms to foreign fighters. Stop the flow of foreign fighters across the borders," Rice told ABC's "This Week."

Hours earlier, al-Maliki's office announced that Iranian President Mahmoud Ahmadinejad had telephoned to say a delegation from his country would attend the conference.

Iraqi leaders had been pressing for the Iranians to attend the Egypt meeting for weeks, but Iran refused to commit, in part because of fears that it would come under pressure from the U.S. and others about its nuclear program.

In addition, the Iranians have been lobbying for release of five Iranians held by the U.S. in Iraq since January. The U.S. has accused the five of links to an Iranian Revolutionary Guard unit that arms and trains Shiite extremists in Iraq and elsewhere in the Middle East.

The decision to attend "came after consultations between Iraqi officials and the Iranian president," Foreign Ministry spokesman Mohammad Ali Hosseini said in an interview with Iranian state television.

Senior Iranian envoy Ali Larijani flew to Baghdad on Sunday for talks with al-Maliki and other senior Iraqi officials — the highest-ranking Iranian official to visit Iraq since the collapse of Saddam Hussein's regime in 2003.

During their meeting, Larijani told al-Maliki that all countries that want stability in the region "have no choice but to support Iraq's elected government."

Al-Maliki replied that terrorist attacks in Iraq would hurt all countries in the region, "including those that are supposed to support the Iraqi government," according to a statement by the prime minister's office. Although al-Maliki did not refer to specific terror groups, it appeared that his remarks were not limited to Sunni insurgents but included Shiite extremists, as well.

On Sunday, U.S. troops in Baghdad clashed with Shiite gunmen in north Baghdad, police said. There was no report on casualties but police said several gunmen were arrested.

In Tehran, the head of the Iranian parliamentary committee on national security and foreign policy, Alaeddin Boroojerdi, also said Iran's failure to participate in Sharm el-Sheik would lay the Islamic republic open to criticism from the United States.

"Iran should attend the conference, actively and powerfully," Boroojerdi was quoted as saying by Iran's official Islamic Republic News Agency.

Apart from security issues, the U.S. and Iraq hope the conference will produce an agreement to forgive Iraq's huge debts and offer financial assistance in return for an Iraqi pledge to implement political and economic reforms.

But Iraq's Arab neighbors are expected to demand that the Baghdad government, dominated by Shiites and Kurds, do more to reach out to its own disgruntled Sunni Arabs before they pledge substantial aid.

On Sunday, President Bush called Iraq's Sunni vice president, Tariq al-Hashimi, to discuss the importance of the reconciliation process and the need for all Iraqi parties to work together to stabilize the country, according to Gordon Johndroe, a spokesman for the White House National Security Council.

The Iraqis, for their part, were anxious for the Iranians to attend to give them leverage against their Sunni-dominated neighbors and to help press their case that Sunni extremists, including al-Qaida, pose the gravest threat to stability.

Underscoring the threat, Iraqi police reported at least 52 people were killed or found dead Sunday, a relatively low figure in recent weeks.

They included five people killed in a car bombing in the southern city of Basra and 10 men whose bullet-riddled bodies were found dumped in various parts of Baqouba, 35 miles northeast of Baghdad.

Separately, Britain said one of its soldiers was shot to death Sunday while on patrol in Basra. The death brings to 146 the number of British troops killed in Iraq since the 2003 invasion — 12 of them this month.

In Baghdad, U.S. forces fired an artillery barrage in southern Baghdad Sunday morning, rocking the capital with loud explosions.

The size and the pattern of the explosions, which began after 9 a.m. and lasted for at least 15 minutes, suggested they were directed at Sunni militant neighborhoods along the city's southern rim. Such blasts are common in the evening but are rare at that time of day.

In a brief statement to The Associated Press, the U.S. military said it fired the artillery from a forward operating base near Iraq's Rasheed military base southeast of Baghdad, but provided no other details.

American troops also detained 72 suspected insurgents and seized nitric acid and other bomb-making materials during raids on Sunday targeting al-Qaida in Iraq in Anbar province, a Sunni insurgent stronghold west of the capital, and Salahuddin province, a volatile Sunni area northwest of the capital, the U.S. military said.

Elsewhere in Iraq, the death toll from a suicide car bomb attack in the Shiite holy city of Karbala rose to 68 as residents dug through the debris of heavily damaged shops.