The attacks began at 02:00 (23:00 GMT Sunday) with the kidnapping of two senior officers from their homes. They were later found shot dead.
The gunmen, some wearing army uniforms, then moved through the city, shooting police at checkpoints.
Police in the city blamed al-Qaeda for the attacks.
According to the Associated Press news agency, an al-Qaeda flag was raised at one of the checkpoints that came under attack.
This is the first major incident of violence in Haditha since a suicide bomber targeted a bank in the city March 2011, killing nine people.
“A total of 26 policemen were killed, including a colonel and a captain, and three others were wounded when several armed men wearing security uniforms and carrying forged arrest warrants attacked several checkpoints,” Maj Tareq Sayeh Hardan, a police spokesman in Haditha, said.
“Al-Qaeda is responsible for this,” he added, saying that al-Qaeda literature had been found in one of the attackers’ vehicles.
The gunmen who entered the homes of the colonel and captain claimed they had warrants for their arrests, Mohammed Fathi, a spokesman for the provincial governor, told the AP.
The two commanders were later found shot dead in the street not far from their homes, Haditha police said.
Mr Fathi told AP the gunmen had false arrest warrants for 15 police officials in the city.
The gang, driving interior ministry-style vehicles, then moved through the city in a convoy that one local lieutenant said was 13 vehicles strong, opening fire on the checkpoints they came to.
The entire raid lasted about half an hour; officials were quoted by the AP as saying.
Haditha lies in Anbar province, a former stronghold of Sunni militants.
Violence in the province dwindled after tribal leaders allied themselves with US forces in 2006.
However, attacks in Iraq have risen since US troops withdrew in December.
Last month at least 55 people were killed and hundreds injured in a day of violence targeting mainly Shia areas across the country.