A gang of gunmen disguised in military-style uniforms and carrying forged arrest warrants killed 25 police Monday, then hoisted the battle flag of Al Qaeda in a carefully planned early morning shooting spree in western Iraq, officials said.

The killings in Haditha highlight Al Qaeda's success in regaining a foothold in an area they once dominated through police executions and murdering city officials.

By going after police, the militants demonstrate to the residents of Haditha, a desert city closer to the Syrian border than to Baghdad, how isolated they are from the central government's protection and intimidate those who want to join the security forces.

The city's proximity to the border, just 65 miles away, means it is vital territory to Al Qaeda if they want to ramp up operations in Syria to help overthrow the government of President Bashar Assad. Already, Sunni militants who revile Assad because he's a member of an offshoot religion of Shiism are crossing from Iraq into Syria.

The killings carried out by Al Qaeda Monday morning demonstrated a high degree of coordination, knowledge of their targets and a boldness that indicated little fear of the local security forces ability to fight back.

The violence began with an attack on a suburban checkpoint around 2 a.m. in Haditha and ended with the gang disappearing into the desert a half hour later.

"We consider this attack as a serious security breach and we believe that Al Qaeda or groups linked to it are behind this," said Mohammed Fathi, spokesman for the governor of Iraq's western Anbar province where Haditha is located.

Iraqi officials described a systematic plot to kill police in Haditha, 140 miles northwest of Baghdad, with attackers disguising themselves in military uniforms and driving cars painted to look like Iraqi interior ministry vehicles.

Fathi said the gang claimed they were military officials with arrest warrants for city police. They were stopped at a checkpoint outside Haditha, where they took away the guards' mobile phones before shooting nine of them, he said.

The gang's convoy, described by one Haditha police lieutenant as stretching 13 cars long, then stopped at the homes of two Haditha police commanders, including the colonel who served as the city's SWAT team leader. Brandishing the fake arrest warrants, the gunmen forced the commanders into the convoy, and shot both less than a quarter-mile away, Fathi said.

Fathi said the gang had false arrest warrants for 15 police officials in Haditha. As their convoy moved through the city, they were stopped at another checkpoint near the city's main market. A fierce gun battle broke out, with the gang raising the black flag of Al Qaeda in a show of defiance.

Six policemen were killed in that skirmish, and another six were killed in shootings as security forces chased the gang through the city, Fathi said.

Most of the gang escaped, fleeing north into a desert area in bordering Ninevah province known as Jazeera, according to a police lieutenant in Haditha. On the way out, Fathi said, another two policemen were killed at a checkpoint on Haditha's outskirts.

Police at the scene said three of the attackers were killed but the rest escaped. Fathi said only one insurgent's body has been identified. Such confusion is common in the immediate aftermath of an attack in Iraq.

Haditha is a former Sunni insurgent stronghold of about 85,000 people in a valley where the Euphrates River runs through the desert. It is halfway between Baghdad and the border town of al-Qaim, which for years was a way station for insurgents coming into Iraq from Syria. Within a year of the 2003 U.S. invasion, Haditha was the headquarters for Abu Musab al-Zarqawi, the slain leader of Al Qaeda in Iraq.

For many Iraqis, the city is a symbol of some of the worst atrocities during the war.

The mayor of Haditha and his son were executed in July 2003. The next year, after U.S. forces pulled back their protections, insurgents executed dozens of local policemen in a soccer stadium. U.S. troops returned to Haditha with force in 2005, but at least 20 Marines and an interpreter were killed in separate attacks.

But it was a November 2005 bombing that touched off an attack that still has people in Haditha seething.

A Marine convoy hit a roadside bomb in Haditha that day, killing three U.S. troops. Incensed, the surviving Marines shot five men by a car at the scene and stormed several nearby houses, where they cleared rooms with grenades and gunfire. Twenty-four Iraqis were killed, including unarmed women and children. Only one Marine was convicted, although he was spared prison time.

The dominant Sunni tribe in Haditha are the al-Jughaifi. The SWAT team leader, Col. Mohammed Hussein, was a al-Jughaifi tribesman, and was also a founding member in Haditha of the Sahwa militiamen, or Awakening Councils, that joined forces with the U.S. military to fight al-Qaida at the height of Iraq's insurgency. The al-Jughaifi are traditionally farmers or smugglers who live in the area between Haditha and al-Qaim.

Many tribesmen were Al Qaeda until they switched allegiances to the U.S. military.

The Jazeera desert area is also a few hours from the Syrian border. Iraqi intelligence officials say weapons smugglers and fighters have secretly crossed into Syria to fight alongside local opposition forces against Assad.

Insurgent groups have been hammering Iraqi security forces with attacks, seeking to undermine the public's confidence in the ability of their policemen and soldiers. The impersonation of military personnel by insurgents also makes citizens distrustful of anyone wearing a uniform.

Monday's strike was the third in as many weeks that showed evidence of careful planning by an insurgency bent on proving their might.

On Feb. 23, widespread shootings and bombing across Iraq killed 55 and wounded more than 200 in attacks for which Al Qaeda immediately claimed responsibility. Two days earlier, a suicide bomber detonated his car as a group of police recruits left their academy in Baghdad, killing 20.

The Haditha lieutenant described Monday's killing spree as "the first bold attack" on the city in years.

Authorities in Haditha quickly locked down the city with a curfew and deployed the Iraqi army there to keep order.