According to Iraqi police sources one of the army units was Kurdish and the other made of Shias.
The US military provided a different account of the incident that occurred after a bombing near Duluiyah, about 75km north of the capital on Friday.
The US account said one soldier from the Iraqi army's First Battalion was killed and 12 were wounded in the attack.
Ali Ibrahim from the Iraqi police said four were killed and three others wounded. He identified the soldiers as Kurdish but did not specify their unit.
The wounded were rushed to the US military hospital in Balad and police said that when the Kurdish soldiers drove up to the hospital, they began firing weapons to clear the way, killing a Shia civilian.
When security rushed to the scene, the Kurds decided to take their wounded elsewhere, Iraqi police said.
Iraqi troops from a separate Shia unit tried to stop them and shots were fired.
The US statement did not say what prompted the soldiers to try to take wounded comrades away from a hospital that is one of the best equipped American medical facilities in Iraq.
A third Iraqi unit set up a roadblock in the area and stopped the soldiers who were leaving, the US said.
American troops then arrived on the scene and calmed the situation down.
The US said the Iraqi army was now investigating the incident.
Thousands of Kurdish peshmerga militiamen were integrated into the Iraqi army in order to provide security in areas with large Kurdish populations, some of which are located near Shia and Sunni Arab communities.
The peshmerga also provides security in the three provinces that form the Kurds' self-governing entity in the north.