They said the dawn attack began with militants firing mortar rounds on Iraqi army bases in the town of Taji where suspects accused of terrorism were being held, prompting officials to evacuate the facilities, fearing a jailbreak.

As the convoy traveled through a remote area, roadside bombs went off and militants opened fire. The attack killed 52 prisoners and eight soldiers, while wounding eight soldiers and seven prisoners.

The town of Taji is located some 20 kilometres (12 miles) north of the capital.

The officials — two policemen, an army officer and a medical official — spoke on condition of anonymity as they were not authorized to release information.