"After clashes that lasted about 15 minutes [at a security checkpoint], the gunmen fled, and the army chased them in order to arrest them," Ibrahim said.

"The gunmen entered one of the houses close to the checkpoint, and the army followed them. The house then collapsed because of a bomb. The gunmen escaped through a back door."

Three other bodies were found under the rubble, but it was not immediately clear if they were of gunmen or civilians, he added.

A police source said the soldiers had entered the house acting on a tip that hostages from kidnappings were held inside.

Overall, violence in Iraq has ebbed since the peak of sectarian warfare four years ago but bombings and other attacks occur frequently.

Tensions have been steadily rising since a March 7 parliamentary election produced no clear winner.