A US military spokesman said on Friday morning that soldiers sustained no injuries in the overnight armed confrontation.
It was unclear whether the troops had been American, the spokesman added.
"We are still trying to find out more details," he said, about the attack in the Iraqi city 370 kilometres (240 miles) north of Baghdad.
In the gun battle, "three were killed on the Iraqi side and no injuries on the coalition side," said the spokesman.
But other reports said US soldiers opened fire on Iraqis trying to hijack a Turkish truck. According to local police on the scene, five were killed.
A loud boom was heard on Friday in Baghdad just hours before the nation's leaders were due to sign officially an interim constitution for the nation's immediate future, but the cause of the noise was unclear.
A US army spokesman was unable to confirm the source of the boom, which shook the centre of the city.
Elsewhere in Iraq, at least three Iraqi civilians were killed In Baghdad on Thursday when a rocket slammed into a street near a telephone exchange.
Police at the scene of the attack said the rocket had skidded along the ground after the initial impect, hitting a car and killing its occupants. Another two people were injured.
As a crowd gathered around the mangled remains of the vehicle, people began chanting anti-US slogans, saying "America is the enemy of God".
Anti-US sentiment has been running high in Iraq since a series of anti-Shia attacks killed about 200 civilians in the holy city of Karbala and Baghdad during ceremonies commemmorating Ashura on Tuesday.
They were the worst attacks since the fall of Iraqi leader Saddam Hussein.