* Islamists raise ISIL flag over government buildings
* Police say three other villages under ISIL control
* Suicide bomb kills six at Anbar military base
* Car bombs kill three Tikrit policemen (Adds defence ministry statement)
By Suadad al-Salhy
BAGHDAD, Feb 22 (Reuters) - Militants shot down a helicopter on Saturday and briefly occupied a town, in an escalating turf war with Iraq's government that has killed at least 25 people in two days, police said.
All four crew members were killed when their helicopter was downed during a reconnaissance flight over the town of Karma in Iraq's western province of Anbar, where the army is engaged in a standoff with anti-government fighters.
Sunni Islamist insurgents have been gaining ground in Iraq over the past year and in recent weeks overran several towns, raising the stakes in a conflict against the Shi'ite-led government that made last year the deadliest since sectarian civil strife began to abate in 2008.
Late on Friday, dozens of militants in SUVs drove into the small town of al-Sainiyah, near Baiji, some 180 km (110 miles) north of Baghdad, after bombing the local police headquarters, and fought troops for several hours overnight, witnesses said.
At least four policemen and two Sunni government-backed militia members were killed in the fighting, officials said.
The militants raised the black flag of the Islamic State in Iraq and the Levant (ISIL) over government buildings in the town, recording their victory on video, before withdrawing on Saturday morning.
"The attack started at 7:30 pm (Friday) when we heard intense gunfire and successive mortar explosions near the police department. This situation lasted for around three hours," a resident called Yasser told Reuters by telephone.
He said the militants drove around the town all night, blasting religious anthems glorifying ISIL from their cars.
"WAR OF ATTRITION"
Police sources said the militants came from Anbar province, where the Iraqi army has been laying siege to the city of Falluja and shelling it since early this year, when ISIL and other militant groups took over.
A suicide bomber driving a car packed with explosives blew himself up at the entrance to a military base in the east of Anbar's capital, Ramadi, killing at least six people on Saturday, security sources said.
Tens of thousands of people have fled the city in recent weeks, fearing an all-out ground offensive to retake Falluja, the site of some of the fiercest battles with U.S. forces following the invasion of Iraq in 2003.
In a statement late on Saturday, the Ministry of Defence said it was suspending military operations on Falluja until 6 a.m. on Monday to give local tribes another chance to expel militants themselves.
The Defence Ministry warned militants against taking advantage of the detente to carry out attacks against the armed forces, civilians, government installations and hospitals in order to give the impression the government had not kept its word.
"We confirm that we will follow up and investigate any such wicked moves and the response will be violent and harsh," the statement read.
Security officials say ISIL, which is also active in neighbouring Syria and seeks to establish a Sunni state spanning the border into Iraq, wants to divert the security forces' attention away from Falluja.
"It's a war of attrition and they are attempting to exhaust the capabilities of the army by dragging it into sporadic fighting here and there," a senior security official, who declined to be named, told Reuters.
"ISIL is still looking to find a suitable land to plant the seed of their Islamic emirate."
By Saturday, troops had regained control over most of Sulaiman Pek, another town in northern Iraq overrun last week by militants who also raised ISIL's banner, senior security officials said.
Three villages near Sulaiman Pek, 60 km north of Baghdad, remain under the control of militants, they said.
Separately, five policemen were killed when gunmen opened fire at a checkpoint in a village east of Baquba, 65 km northeast of Baghdad, police said.
A further three policemen were killed in three car bomb explosions on Saturday near the homes of police commanders in Tikrit, 150 km north of Baghdad, said police.
Police declared a curfew in the city and its suburbs in response, anticipating more attacks.
Last year was Iraq's bloodiest since sectarian violence began to abate in 2008.
Deteriorating security in northern and western Iraq has raised doubts that parliamentary elections can be held nationwide in April as scheduled. (Additional reporting by Ghazwan Hassan; Editing by Isabel Coles and Robin Pomeroy)