The bomber detonated his explosives, killing Hattab and a recruit and wounding 10 more, police and a doctor said -- a toll that would almost certainly have been higher were it not for the policeman's sacrifice.
Another Iraqi policeman also gave his life to protect Shiite pilgrims from a suicide bomber in December last year.
Militants killed 13 members of the security forces on Thursday in the northern province of Nineveh, one of the most dangerous areas in Iraq.
In Mahallabiyah, west of Nineveh's capital Mosul, militants with automatic weapons attacked a military site, killing 12 soldiers and wounding 15, while a police colonel was gunned down southeast of the city, a police officer and a morgue employee said.
Near the town of Tuz Khurmatu, north of Baghdad, militants who blocked a road and searched cars found three soldiers in a minibus and killed them, police Colonel Mustafa al-Bayati said.
Shallal Abdul Baban, a local official responsible for the Tuz Khurmatu area, said the soldiers were shot in the head, and added that the militants also beat the bus driver, injuring him.
- Even secure buildings targeted -
In Baghdad, a car bombing in the Karrada district killed at least three people and wounded at least 12.
Thursday was the deadliest day for the Iraqi army since February 11, when 17 soldiers were killed.
Militant groups frequently target the security forces, some of whom lack adequate training and discipline.
They are even able to hit targets that should be highly secure, such as government buildings, police stations, prisons and military installations.
The justice ministry announced earlier this week that Iraq's infamous Abu Ghraib prison west of Baghdad has been closed because of security fears.
Abu Ghraib and another prison near the city 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 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".
In another sign of the reach of militant groups and the weakness of security forces, anti-government fighters have since January held all of the city of Fallujah near Abu Ghraib, and shifting parts of Anbar provincial capital Ramadi, farther west.
The security forces face a major test on April 30 when Iraqis vote in the first parliamentary election since American forces withdrew at the end of 2011.
The rising 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.
It has also been fuelled by the civil war in neighbouring Syria.
More than 410 people have been killed in violence this month, according to AFP figures based on security and medical sources.