The military also said 12 suspects were detained.
"The individuals detained and the terrorists killed during the raid are believed to be members of a cell of a Special Groups terrorist network known for facilitating the transport of weapons and explosively formed penetrators, or EFPs, from Iran to Iraq, as well as bringing militants from Iraq into Iran for terrorist training," the military said.
The statement came after Iraqi police in Sadr City said a bombardment by U.S. helicopters and armored vehicles killed nine civilians, including two women, and wounded six others. The police also said 12 people were detained.
Meanwhile, Iraqi Prime Minister Nouri al-Maliki arrived in Iran on Wednesday for talks expected to focus on bilateral relations and overcoming "terrorism challenges" in his wartorn nation.
It was the Iraqi premier's second visit to Tehran in less than one year.
Iraq, which like Iran is majority Shiite Muslim, has managed a difficult balancing act between Tehran and Washington since the U.S.-led invasion in 2003, trying to maintain good relations with its powerful neighbor while not angering Americans.
The U.S. has accused Iranians of providing money and weapons to Shiite militias in Iraq. Tehran denies the charges and argues that the presence of U.S. troops is destabilizing the region.
The two nations have held three rounds of talks on Iraqi security since May, and al-Maliki said he would push for these talks to continue at an ambassador level.
State television said he was received in Tehran by First Vice-President Parviz Davoodi and would hold talks with other Iranian leaders during his visit, expected to last three days.
"We are here today to boost commercial and security relations with neighboring countries against the terrorism challenges in the area," al-Maliki told The Associated Press on the plane to Iran.
The premier, who is a Shiite and is deemed a close ally of Iran's Shiite regime, said he would also discuss and sign a number of cooperation memorandums with Tehran. He did not elaborate.
In an apparent gesture of welcome, Iran's Payam state radio played Arab-style belly dancing music early Wednesday, a rare event in this conservative Islamic country.
In other developments: