Two activist groups said Tuesday’s air raids struck the town of al-Bab in Aleppo province.
Two soldiers and three of the gunmen were dead in the attack.
Muslim extremists have long dreamed of recreating the Islamic state, or caliphate, in various forms over the course of Islam’s 1,400-year history.
Two men on a motorcycle opened fire at Brigadier-General Abdullah al-Mehdar and fled, said the Defense Ministry.
Al-Maliki’s Shiite-led government has long been accused of discriminating against Iraq’s Sunni and Kurdish populations.
The killings were the first hints of the beginnings of a return to sectarian violence that nearly tore the country apart in 2006 and 2007.
Al- shabab’s attack highlights growing incidents of Islamic extremist violence.
The assault came late Sunday night as town residents were watching World Cup matches on TV.
The return underscores the profound sectarianism cleaving Iraq and the anger that Sunnis have for al-Maliki’s government.
Nearly three million Syrians have fled the country.
Obama huddled with his national security team Thursday to discuss the deteriorating security situation.
“They have surrounded the city. There are no entrances or exits left for people to flee,” said a Syrian activist in the region.
The officials say the provincial governor based in the city is missing.
The military and police have been hunting him for his alleged involvement in bombings and kidnappings.
It said the tally includes 39 civilians, 354 rebel fighters, including many from the Nusra Front, and 241 gunmen from the Islamic State.