Three soldiers were among the dead in the attack in the town of Khales, north of the Diyala provincial capital Baquba, the sources said.
Faced with a militant offensive sweeping south toward Baghdad, Prime Minister Nuri al-Maliki announced the Iraqi government would arm and equip civilians who volunteer to fight, and thousands have signed up.
And on Friday, influential Shiite cleric Grand Ayatollah Ali al-Sistani issued a call to arms for people to fight "terrorists," a move that will boost recruitment.
They appear to be recovering from the initial shock of the onslaught, and have pushed back, recovering some areas north of the Iraqi capital.
But swathes of territory remain outside government control.