He added that another 28 people were wounded in the attack. The Islamic State group claimed the attack in a statement posted on a militant website.
Another police officer said a suicide car bomb struck a passing military convoy at around the same time in the southern suburb of Arab Jabour, killing four soldiers and wounding eight others.
Two medical officials confirmed the casualty figures. All officials spoke on condition of anonymity as they were not authorised to release the information.
Iraqi forces backed by US-led airstrikes have pushed IS back on a number of fronts in recent months, clawing back territory seized by the extremists during their sweep across northern and western Iraq in 2014.
But IS has continued to carry out attacks in and around Baghdad, mainly targeting security forces and the country’s Shia majority.