At one house, Iraq’s national flag fluttered atop a building that Iraqi soldiers had captured from militants two days before.

At another, smashed household goods and furniture were scattered on the floor.

Outside a third, hosting a meeting of Iraqi security force commanders, a captain from Iraq’s national intelligence service pointed to the far side of a murky irrigation canal.

“Here it is safe now,” he said of Al-Daira. “But over there are more terrorists. That is where we will fight them next.”

The village of Al-Daira lies about 30 miles south of Baghdad and within sight of Iraq’s main highway, in an area the American military called the Triangle of Death.

A former militant stronghold, the area is a battleground again. The Qaeda splinter group now known as the Islamic State in Iraq and Syria, or ISIS, has resumed a campaign that its predecessors started — and had appeared to lose — before the United States withdrew its troops in 2011.

The group’s tactics — a hybrid guerrilla-and-terrorist campaign of ambushes, bombings and sniper and mortar attacks, organized by fighters who blend among civilians — show that the militants are much more than a juggernaut, as lately portrayed. They are adaptive and alert to the lessons of Iraq’s insurgent past, and select different tactics for different places and situations.

While establishing themselves in Anbar, in the west, they methodically resumed the campaign south of Baghdad started by Al Qaeda in Iraq, the Sunni militant group that formed after the American invasion and swore allegiance to Osama bin Laden.

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-Qaida in a carefully planned early morning shooting spree in western Iraq, officials said.

The killings in Haditha highlight al-Qaida'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-Qaida 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-Qaida 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-Qaida 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 (220 kilometers) 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 (400 meters) away, Fathi said.