A police officer in Mosul identified the assailant as Hassan al-Dulaimi, a soldier who also served as the imam of a mosque at an Iraqi army training centre south of Mosul, the capital of Ninawa.
He said the American soldiers were doing exercises in the training centre's yard at the time of the attack. He said he had no knowledge about the fate of the assailant.
Saad Ali al-Jubouri, mayor of Hammam al-Alil, said he saw US helicopters hovering over the area and that the roads leading to the training centre had been sealed off.
US and Iraqi military commanders say Mosul is the last remaining urban stronghold of al-Qaeda in Iraq and about a dozen other Sunni anti-government groups.
Some of these groups have infiltrated Iraqi forces in the past.
US troops could stay in Mosul beyond a June 30 deadline for withdrawing from Iraqi cities if Baghdad requests it, according to a Status of Forces Agreement (Sofa) concluded between the two states in November.
"We really look at trends, we don't look at single events, because whatever we do for a strategy is a months-long strategy," Major General David Perkins said on Friday.
He admitted, however, that US commanders were negotiating with their Iraqi counterparts over Mosul and that the question of whether US troops would remain there past the June 30 deadline was "undecided."
An Iraqi soldier went on the rampage last November at a joint security station in Mosul, shooting dead two US soldiers and wounding six.
The US military blamed the attack on al-Qaeda in Iraq.
In December 2007, an Iraqi soldier opened fire on US troops during a joint patrol in Mosul, killing two and wounding three.
In all, at least 4,283 members of the US military have died in the Iraq war since it began in March 2003, according to an AFP count based on an independent website.
Civilian deaths in Iraq in April were also higher than previous months following a series of bombings that killed more than 200 people.
At least 355 Iraqi civilians and Iraqi security forces were killed in violence in April, according to a monthly death toll issued by various Iraqi government ministries.
There are currently about 142,000 US troops stationed in Iraq.