BAGHDAD - Eight Iranians, including two diplomats, were released by U.S. forces Wednesday after being detained because unauthorized weapons were found in their cars, the U.S. military said. An adviser to the top U.S. general in Iraq called the detentions "regrettable."

The incident Tuesday came as tensions between Washington and Tehran were already strained by the detention of each other's citizens as well as U.S. accusations of Iranian involvement in Iraq's violence and alleged Iranian efforts to develop nuclear bombs.

Iraqi Foreign Minister Hosyhar Zebari told the British Broadcasting Corp. the Iranians were released after Iraqi officials intervened and told the Americans they were part of an official delegation on a legal visit to discuss electricity cooperation.

In Tehran, the Foreign Ministry on Wednesday summoned the Swiss diplomat representing U.S. interests in Iran to protest the detentions. Switzerland looks after the U.S. interests in Iran in the absence of formal diplomatic relations between Tehran and Washington.

Foreign Ministry spokesman Mohammad Ali Hosseini said the Iranian delegation was in Baghdad to hold talks with Iraqi officials on building a power plant.

"These actions are contrary to the responsibilities of foreign forces in Iraq and is another mistake in the erroneous behavior of the Americans," Hosseini was quoted as saying by state-run television.

Four cars carrying the Iranians, as well as seven Iraqis, were stopped at a checkpoint Tuesday evening and then allowed to proceed to the nearby Sheraton Ishtar hotel, where they were later taken into custody and questioned, the military said.

Saadi Othman, an adviser to Gen. David Petraeus, the top U.S. general in Iraq, told British Broadcasting Corp. television that the detentions were "regrettable" and had "nothing to do" with President Bush's remarks on Tuesday, when he lashed out at Iran for meddling in Iraq's affairs and fomenting instability here.

The Iraqi foreign minister said the detentions were a result of "miscommunication and misunderstanding, and some misinformation." The group was here to discuss Iran supplying Iraq with electricity, Zebari said.

"These Iranians were part of an official delegation visiting the Ministry of Electricity in Baghdad by invitation and they were staying in one of the hotels in Baghdad when an American force arrested them," he told the BBC. "After we intervened with the embassy and explained the situation, that they were here on legal grounds on a legal basis and they have their visas, their credentials were established, then they were released this morning."

He added that it had nothing to do with Bush's speech.

"What happened in Baghdad with the arrest of the seven Iranians, there was no linkage, no connection whatsoever," he said.

Bush strongly criticized Iran in a speech to the American Legion convention in Reno, Nev., in which he presented a ringing defense of the unpopular Iraq war effort.

"I have authorized our military commanders in Iraq to confront Tehran's murderous activities," said Bush, whose administration has accused Iran of arming Shiite militias in Iraq. "The Iranian regime must halt these actions."

Troops seized three weapons from the cars -- an AK-47 assault rifle and two 9mm pistols that had been in the possession of the Iraqis in the group. The Iraqis were serving as a protective detail but had no weapons permits, the U.S. military said.

Videotape shot Tuesday night by AP Television News showed U.S. troops leading a group of blindfolded and handcuffed men out of the hotel in central Baghdad. U.S. troops confiscated a laptop, cell phones and a briefcase full of Iranian and American money in the hotel, the military said.

"Following the brief room search, the group was taken to a coalition facility for questioning," the U.S. military said in a statement. "The Iranian nationals had passports. It was later determined that two of the Iranian individuals were carrying diplomatic credentials."

All the Iranians were released Wednesday to Iraqi officials, the military said. The fate of the Iraqis -- who identified themselves with Iraqi Ministry of Electricity badges -- was not immediately clear, and the military did not say whether the confiscated items were returned.

An Iranian diplomat, who refused to give his name, told The Associated Press that one of those released contacted the embassy Wednesday to say that they had been handed over to Iraqi authorities.

"At 7 a.m. today, a member of the delegation called the embassy and said they are now at the prime minister's office," the diplomat said. "The Americans released them. They held them until seven this morning."

The Electricity Ministry declined comment and Iraqi government spokesman Ali al-Dabbagh was not available for comment because he is not in Baghdad, his office said.

The Iranian Embassy said the Iranians included two of its staff and six members of a delegation from Iran's Energy Ministry. The diplomat had earlier said there were seven Iranians held and one diplomat.

The embassy said the men had not yet been in to explain in full what happened, and that it was not sure whether their belongings had been returned.

Iran has constantly complained about the U.S. detention since Jan. 11 of five Iranians who were in the northern Iraqi city of Irbil. U.S. officials say the five include the operations chief and other members of Iran's elite Quds Force, which is accused of arming and training Iraqi militants.

The Iranian regime denies any involvement in violence in neighboring Iraq.

U.S. authorities are unhappy about Iran's arrest of four people with dual American-Iranian citizenship for allegedly seeking to undermine the Islamic republic's security. Two are imprisoned in Iran, while two are free but barred from leaving the country.

Relations also are tense over the suspicions of the U.S. and its allies that Tehran is using its civilian nuclear power program as a screen to develop atomic weapons. Iran denies that, saying the program only has the peaceful aim of generating electricity.

The strains have many people in the region worried about the possibility of fighting between the U.S. and Iran.

But while making his latest defense of Iran's nuclear program earlier Tuesday, Iranian President Mahmoud Ahmadinejad dismissed the possibility of any U.S. military action against Iran, saying Washington has no plan and is not in a position to take such action.

Ahmadinejad declared that U.S. political influence in Iraq is "collapsing rapidly" and that Tehran is ready to help fill any power vacuum.