The attack took place soon after midnight about 500 kilometres (310 miles) west of Baghdad in mostly Sunni Anbar province, according to a police officer in Ramadi, the provincial capital.
Five policemen, including a lieutenant, were killed, he said on condition of anonymity.
One of the attackers was killed in clashes that ensued between the gunmen and police, while the others set off a bomb attached to a nearby caravan and, using that as a distraction, fled the scene.
The total number of gunmen who carried out the assault was not clear.
A medic at Ramadi hospital confirmed the facility received the bodies of the five policemen killed, and that they died of gunshot wounds.
The attack came on the heels of a similar assault on a police compound in Ramadi itself, where a series of car and suicide bombs preceded gunmen storming the compound and laying siege to it, killing seven policemen before blowing themselves up.
Anbar was a key Sunni insurgent base in the years after the US-led invasion of 2003, but after 2006 local tribes sided with the American military against Al-Qaeda and day-to-day violence has dropped dramatically.
However the province, particularly its capital, has been the target of frequent attacks since.