The troops were targeting the commander of a rogue militia group believed to be associated with the Quds Force, a branch of the Iranian Revolutionary Guards, the U.S. military said.
Gunmen opened fire on the soldiers with assault rifles, rocket-propelled grenades, and at least one man was carrying what appeared to be an anti-aircraft weapon, the military said. Ground forces called for air support when the fighters kept coming toward them and the military said 25 militants were killed and two buildings destroyed in air strikes.
The military said the targeted commander was responsible for moving weapons from Iran into Baghdad.
The military also reported the death of a U.S. soldier, killed by small arms fire during operations Thursday in a southern section of the Iraqi capital. The section of the city is used by al Qaeda cells as a support zone, the military said.
In the pre-dawn raid Friday, U.S. aircraft repeatedly bombed the neighborhood in Khalis, a Shiite enclave about 50 miles north of Baghdad, according to an Iraqi army official who spoke on condition of anonymity because he was not authorized to release the information. At least 24 were killed, 28 were injured, most of whom were in critical condition, and several others were missing, he said.
He said civilians were killed when they rushed out to help those hurt in the initial bombing.
The U.S. military said it had no reports that any Iraqi civilians were killed as a result of the Friday operation.
"Coalition forces only engage hostile threats and take every precaution to protect innocent civilians," the military said in a separate statement.
The town's mayor said U.S. forces targeted areas built up by locals to protect their Shiite neighborhood against attacks by al Qaeda gunmen.
"These places came under attack by American air strikes," said Khalis Mayor Odai al-Khadran.
Since launching a Baghdad security crackdown more than seven months ago, U.S. troops have increasingly engaged rouge Shiite militiamen and splinter groups from the country's most powerful Shiite militia, the Mahdi Army. The U.S. military describes the splinter factions as "extremist" or "criminal" militiamen.
"We continue to support the government of Iraq in welcoming the commitment by Muqtada al-Sadr to stop attacks and we will continue to show restraint in dealing with those who honor his pledge," Maj. Anton Alston, a U.S. military spokesman, said Friday. "We will not show the same restraint against those criminals who dishonor this pledge by attacking security forces and Iraqi citizens."
The Mahdi Army is nominally loyal to al-Sadr, the radical cleric, who in August ordered a temporary freeze on his followers' activities - including attacks on U.S. troops.
Last month, the U.S. military arrested a man suspected of being a ranking officer of Iran's Quds Force, the paramilitary branch of the Islamic regime's Revolutionary Guards, which has been accused of arming Shiite militants in Iraq. Iran denies the charges. The arrest has added to the already strained relations between Washington and Tehran.
The arrested Quds officer, Mahmudi Farhadi, was posing as a businessman with an Iranian trade delegation at the time of his arrest in a U.S. raid at a Sulaimaniyah hotel, the military has said.
In January, five other Iranians accused of being members of the Quds Force were arrested in a U.S. military raid in Irbil. They remain in U.S. detention. Iran says the men were in Iraq on official business.
In other developments: