Mobile phone footage circulated on social media showed charred bodies and extensive destruction in the Bayaa neighbourhood where the explosion went off around 4:15 pm (1315 GMT).
A police colonel gave initial casualty figures of 39 killed and 61 wounded but said the emergency services were struggling to cope with the scope of the attack and warned that the death toll may rise.
Hospital officials confirmed the casualty toll for the attack, for which there was no immediate claim of responsibility.
At least 11 people were also killed in a suicide car bomb attack claimed by the Islamic State jihadist group yesterday in a northern neighbourhood of the Iraqi capital.
Baghdad was rocked by a wave of deadly suicide bombings during the first days of 2017 but relatively few explosions had been reported since then until this week.