BAGHDAD—An Iraqi counterterrorism commander based in the northern city of Mosul and renowned for his relentless pursuit of al Qaeda-linked militants was killed Wednesday by two suicide bombers, security officials said.

The commander's slaying in this predominantly Sunni Arab city, which remains one of the most volatile spots in Iraq despite a sharp drop in overall violence, came two days after suicide bombers targeted government offices in Ramadi, another mainly Sunni city west of Baghdad.

Wednesday's attack happened at dawn and initially involved a group of four suicide bombers trying to infiltrate a base for Mosul's Emergency Response Brigade, or ERB, according to Maj. Gen. Abdullah al-Baider, deputy commander of a security taskforce in Mosul.

Guards manning watchtowers at the base shot and killed two of the suicide bombers, but the remaining two managed to run into a small building serving as the living quarters of Lt. Col. Shamel Ahmed Ugla, the ERB commander, Gen. Baider said.

He said the two bombers detonated their payloads inside while Lt. Col. Ugla was asleep, bringing down the entire building. Lt. Col. Ugla had escaped several attempts on his life in the past and in one incident three months ago personally tracked down and killed a suicide bomber dispatched for him, Gen. Baider said.

Meanwhile, Qasim Abed, the governor of Anbar province, said al Qaeda-linked insurgents were most likely behind Monday's attack near the provincial government's compound in Ramadi that involved one suicide car bomber and a suicide bomber on foot and killed nine and wounded 41.

"They are sending us a message that they're still around," Mr. Abed said.

Both the Ramadi and Mosul attacks come after a series of recent announcements by top officials at Iraq's interior and defense ministries touting the capture or killing of dozens of alleged al Qaeda fighters in Anbar, Baghdad and Mosul.U.S. military commanders have substantiated some of these claims but have warned against celebrating any premature victory over militants and insurgents in Iraq.

"From our perspective we are not across the goal line dancing in the end zone yet, we still have a lot of bad people out there," said Brig. Gen. Ralph Baker, former deputy commander for U.S. troops in Anbar and Baghdad before the end of his tour in Iraq this month.