Ambassadors from Iran and the United States met on the sidelines of an Iraq summit, a U.S. official confirmed Friday, but noted that it was unplanned and lasted only a few minutes.

U.S. ambassador to Iraq Ryan Crocker said handshakes were exchanged and the two sides did speak briefly on the need to stabilize Iraq. But he described the meeting as more of an encounter that lasted about three minutes.

"This was not a date," Crocker said, adding that the meeting ended with him saying, "have a nice day."

Earlier, Iraqi Foreign Minister Hoshyar Zebari said delegates from the two sides had met on the sidelines of the regional conference on Iraq, but that meeting did not include Secretary of State Condoleezza Rice or Iranian Foreign Minister Manouchehr Mottaki.

"I believe it was positive and indications are positive," Zebari said as he described the meeting.

Crocker, who was joined by State Department Iraq policy coordinator David Satterfield, said the Iranian delegation was led by Deputy Foreign Minister Abbas Aragachi.

It was the second such meeting between the U.S. and Iran, at a lower-than- foreign-minister level, since March 10.

In a speech to delegates at the conference Friday, Mottaki said the United States must accept responsibility for the terrorism and violence resulting from its "occupation" of Iraq.

The U.S. should present a clear plan to withdraw its forces "in order to allow the return of peace and stability," he said.

Mottaki's speech angered the Iraqi delegation, led by Prime Minister Nouri al-Maliki, who has sought to bridge the disputes between Tehran and Washington and — more broadly — rally all the deeply divided nations of the region behind a plan to stabilize Iraq.

His comments were just "to settle accounts," said one al-Maliki aide, speaking on condition of anonymity because of the sensitivity of the issue. "We didn't expect it to be in this manner."

Mottaki told the delegates that "the continuation of and increase in terrorist acts in Iraq originates from the flawed approaches adopted by the foreign troops. Thus, in our view, the continuation of occupation lies at the origin of the crisis."

"The United States must accept the responsibilities arising from the occupation of Iraq, and should not finger point or put the blame on others," he said.

Mottaki also called for the immediate release of five Iranians detained in northern Iraq by U.S. troops in January, calling their abduction a "brazen contravention of international conventions."

"We hold the perpetrators of this clumsy adventurous act responsible for its consequences," Mottaki said, without naming the United States.

The detention of the five has emerged as a major sore point between the U.S. and Iran. Mottaki had at one point suggested he might not attend the two-day conference in the Egyptian resort of Sharm el-Sheik unless the five were freed. The United States accuses the five of helping finance and arm militants in Iraq, a claim Iran denies.

Meanwhile, at a dinner of diplomats Thursday night where Iran's foreign minister was seated directly across from Rice, Mottaki walked out of the event on the pretext that the female violinist entertaining the gathering was dressed too revealingly.

"I don't know which woman he was afraid of, the woman in the red dress or the secretary of state," State Department spokesman Sean McCormack said Friday.

The dinner episode Thursday night perfectly revealed how hard it was to bring together the top diplomats of the two rival nations at this regional conference.

The Iraqi government had hoped for a breakthrough meeting between Rice and Mottaki. Instead, their only direct contact was a wary exchange of pleasantries over lunch Thursday, punctuated by a wry, somewhat mysterious comment by Mottaki.

Mottaki entered the lunch, greeting the gathered diplomats with the Arabic phrase, "As-salama aleikum," or "Peace be upon you," according to an Iraqi official who was present.

Rice replied to him in English, "Hello," then added: "Your English is better than my Arabic," according to the Iraqi official, who spoke on condition of anonymity because the lunch was private.

Egyptian Foreign Minister Ahmed Aboul Gheit then piped in, telling Mottaki, "We want to warm the atmosphere some."

Mottaki smiled and replied in English with a saying: "In Russia, they eat ice cream in winter because it's warmer than the weather" — more or less meaning, "You take whatever atmosphere-warming you can get."

"That's true," Rice replied, according to the Iraqi official.

After lunch, Aboul Gheit told the Associated Press he would try to arrange a further informal meeting between Rice and Mottaki at a gala dinner being thrown by the Egyptians Thursday night on the beach of a nearby resort hotel.

"Why not?" Aboul Gheit said. "It is only one table." But asked if he would seat Rice and Mottaki next to each other, he said, "No, no."

As it turned out, Mottaki's place was set directly across the table from Rice. When Mottaki's delegation entered the dinner and saw the arrangement, they seemed displeased, said a U.S. official who accompanied Rice. Mottaki immediately told his hosts that he had to excuse himself because of the violinist was "scantily clad," the official said.

Mottaki complained that the Egyptian female violinist playing nearby was too revealingly dressed, the official said, speaking on condition of anonymity, also because the dinner was a closed affair.

FOX News' James Rosen and the AP contributed to this report.