The attack in the Mahallabiyah area west of Mosul also wounded 15 soldiers, while a police colonel was killed to the southeast of the city, a morgue employee and a police major said.
It is the deadliest day for the Iraqi army since February 17, when 13 soldiers died in clashes and an attack.
Iraq is suffering a protracted surge in bloodshed that has killed more than 2,650 people so far this year despite wide-ranging operations against militants by the security forces.
And they are able even to strike at supposedly secure targets, such as government buildings, police stations, prisons and military installations.
More From This Section
The justice ministry announced on Monday that Iraq's infamous Abu Ghraib prison, located west of Baghdad, was closed due to security fears.
Abu Ghraib and another prison near Baghdad were the targets of major assaults by militants last July, in which hundreds of inmates were freed.
Justice Minister Hassan al-Shammari said the ministry's decided to close Abu Ghraib as "part of precautionary measures related to the security of prisons," adding that the facility is "in a hot area."
The security forces face a major test on April 30 when Iraqis vote in the first parliamentary election since American forces left at the end of 2011.
The heightened level of violence that has plagued Iraq over the past year has been driven mainly by widespread anger among the Sunni Arab minority, who say they are mistreated by the Shiite-led government and security forces.
Already this month more than 400 people have been killed in the violence, according to AFP figures based on security and medical sources.