The overnight attack on the Sayyid Mohammed shrine in Balad, which involved suicide bombers and gun and mortar fire, also wounded 50 people, the Joint Operations Command spokesman said in a statement.
The attack followed a devastating bombing in Baghdad that tore through a crowded shopping area early on Sunday ahead of the Eid al-Fitr holiday marking the end of the holy Muslim fasting month of Ramadan, killing 292 people.
The Sayyid Mohammed shrine, located in the Balad area, 70 kilometres (around 45 miles) north of Baghdad, was first targeted with mortar rounds, according to the statement on the attack, which it said it was carried out by the IS jihadist group.
Suicide bombers then arrived at the shrine and opened fire, it said.
Two of the bombers blew themselves up in a market next to the shrine, while the third was killed and his explosive belt defused, it said, without specifying which forces killed the bomber.
The attack came just hours after Iraqi Health Minister Adila Hamoud announced that the death toll from the Sunday bombing had reached 292.
Hamoud said the bodies of 115 killed in the bombing had now been handed over to families, while the identities of 177 others have yet to be determined.
The blast also wounded 200 people, said the minister, who on Tuesday told AFP that the process of identifying the unknown dead — which she put at 150 at the time — was expected to take 15-45 days.
People have been furious over delays in determining the fate of their loved ones, and with the number of unidentified bodies now bigger, it may take even longer.
The attack has overshadowed what would normally be a joyful holiday for Iraqi Muslims, instead turning it into a time of mourning and sadness.
Investigators now believe they know what caused the attack to claim so many lives.
Police Major General Talib Khalil Rahi said the suicide bomber detonated a minibus loaded with plastic explosives and ammonium nitrate.
The initial blast killed a limited number of people, but flames spread and trapped people inside shopping centres that lacked emergency exits, Rahi told a news conference in Baghdad.
The raging fires have made it difficult to identify the dead.