ISIL issued a statement claiming the attack, saying it targeted soldiers and pro-government paramilitaries in the area.
The 'jihadist ' group frequently carries out attacks on security forces, and also often targets members of Iraq 's Shiite Muslim majority, whom it considers heretics.
An ISIL suicide bomber struck shoppers in Baghdad 's central Karrada district earlier this month, killing 292 people.
The group also claimed an attack on a Shiite shrine in Balad, north of the capital, that left 40 dead a few days later.
ISIL overran large areas north and west of Baghdad in 2014, but Iraqi forces have since regained significant ground and are conducting operations to set the stage for the battle to recapture Mosul, the last ISIL-held city in the country.
The 'jihadists ' have responded to the battlefield setbacks by striking civilians, and experts have warned there may be more such attacks as the 'jihadists ' continue to lose ground.