BAGHDAD Police commander Lt. Col. Shamil al-Jabouri knew al-Qaida wanted him dead. He was renowned in the tense northern city of Mosul for his relentless pursuit of the terror group, and insurgents had tried at least five times to kill him for it. On the sixth attempt, al-Qaida left little to chance.

As al-Jabouri slept Wednesday morning on a couch in his office, three men wearing police uniforms over vests laden with explosives slipped through an opening in the blast walls surrounding the compound where his building stood, police said.

Police manning one of at least four observation towers surrounding the compound shot one of the attackers in a yard and his vest exploded. Under the cover of that blast, police said, the other two suicide bombers charged about 100 yards (90 meters) and made it into al-Jabouri's single-story building.

They detonated their vests simultaneously one at the door of al-Jabouri's office killing the commander instantly and injuring a policeman sleeping in a trailer nearby. The two blasts brought the whole building down, burying the slain commander under the rubble, police said.

The attack on the commander responsible for hunting al-Qaida in Mosul a former militant stronghold was a reminder of the significant gaps in Iraqi security, the challenges the new government will face in trying to close them and the lengths insurgents will go to take out people they perceive as threats.

Just 10 days ago, al-Jabouri led a raid that ended in the death of the top al-Qaida figure in Mosul, his colleagues said. And two months ago he had been instrumental in stopping a gang that had been targeting jewelry stores in the city robberies that are frequently ways for terror groups to refill their coffers.

"We've lost a sword of Mosul who chased al-Qaida terrorists out of the city," said Abdul-Raheem al-Shemeri, a top security official on the Mosul Provincial Council.

An Al-Qaida affiliate, the Islamic State of Iraq, took responsibility in a statement posted on the Internet. It said al-Jabouri had been targeted several times before, but had not been deterred from fighting al-Qaida.

"This day was the decisive one," the group said.

According to the militants' statement, the attackers were dressed in police uniforms, which likely helped them get close to the compound an abandoned soccer stadium without raising suspicion.

U.S. Maj. Erik Peterson worked with al-Jabouri as Iraqi police were taking over security from the Iraqi army for the western half of the city, an operation that began last summer.

"He was a legend in the police force," Peterson said. "Every time you would go to visit him, he already had someone new he was looking for or had just arrested."

Peterson said that by killing officials like al-Jabouri, al-Qaida is trying to institute fear in the local population.

Militants had tried to kill al-Jabouri at least five times before, police officials said. A few months ago, al-Jabouri's guards shot a suicide bomber who approached the commander in an attempt to blow himself up, police said.

Hospital officials in Mosul, 225 miles (360 kilometers) northwest of Baghdad, confirmed the death and said at least one policeman was injured.

Rescuers worked frantically to clear the rubble of the collapsed building but found no others dead, probably because the attack occurred in darkness around 6 a.m., before most people had arrived for work.

Al-Jabouri leaves behind a wife and four children. He had been a police officer since 2003. Three of his brothers also serve in the police force, colleagues said.

"He loved his duty, and he had the highest level of commitment to his work," said police official Mazin Mahmud.

Al-Qaida-linked militants across the country, and especially in Mosul, have made wiping out Iraqi security officials like al-Jabouri one of their main goals, in part to intimidate others from joining the security forces. Suicide bombers have been al-Qaida's most lethal weapon, killing hundreds of civilians and members of the security forces.

Mosul is home to a mixed Sunni Arab and Kurdish population, with a small Christian minority. The city along the Tigris River has long been a destination for Sunni militants infiltrating Iraq's porous border with Syria.

Violence has fallen around Iraq in the past two years, but al-Qaida and other insurgents have still shown themselves capable of carrying out attacks, particularly on security and government facilities, in hopes of destabilizing the country.

For much of this year, Iraq's politicians were deadlocked trying to form a new government after inconclusive March elections. The paralysis was resolved only earlier this month when parliament finally confirmed the Cabinet of returning Prime Minister Nouri al-Maliki.

A new government was sworn in only last week but political leaders have still not agreed on who should fill important roles including ministers of defense, interior and national security.