The troops were hit by small-arms fire near Madain, an area with a volatile mix of Sunni and Shiite extremists about 15 miles southeast of Baghdad. A suspected militant also was killed, said Maj. John Hall, a U.S. military spokesman.
The military provided no further details, but a witness said an attacker was waiting in his car until the soldiers came out of the municipal council building in Madain.
"The attacker got out of the car with an AK-47 assault rifle in his hand and he started to fire on the American soldiers until he was killed by return fire," said Hussein al-Dulaimi, who owns an agricultural machines spare parts store across the street.
Al-Dulaimi, residents and a police official said the attacker had been a Sunni member of the municipal council until he was ousted by Shiites during sectarian violence following the February 2006 bombing of a Shiite shrine north of Baghdad.
The death raised to at least 4,103 members of the U.S. military who have died in the Iraq war since it began in March 2003, according to an Associated Press count.
In other developments:
Elsewhere, U.S.-funded Sunni fighters - known as awakening councils - came under attack north of Baghdad late Sunday.
About 10 mortar shells slammed into Udaim, 70 miles north of the capital, killing at least 10 members of a U.S.-backed Sunni group and wounding 24 others, said Maj. Mohammed Thawra, a local Iraqi army battalion commander.
A roadside bomb also targeted an awakening council patrol in Buhriz, 35 miles north of Baghdad on Monday afternoon, killing two of the fighters, a police official said, speaking on condition of anonymity because he wasn't authorized to release the information.
The Sunni revolt against al Qaeda in Iraq has been a key factor in a sharp decline in violence over the past year. The groups have frequently been targeted by insurgents trying to reverse the security gains.
Both attacks occurred in the restive Diyala province, which has been among the hardest areas to control since the 2003 U.S.-led invasion despite an influx of thousands of additional U.S. troops as part of the so-called surge last year.