A suicide bombing at a mosque in al-Jubba killed 10 anti-jihadist fighters. Militants then attacked police and army positions, killing 13, officials said.
A further 28 Iraqi troops were wounded, while militant casualties are unknown.
The incidents took place near the Ain al-Asad airbase, where US forces are currently training Iraq's military.
The attacks were carried out on Tuesday near the town of al-Baghdadi, which is 110 miles (180 km) north-west of Baghdad.
No group has said it was behind the the attacks. However, they come as Iraqi forces battle fighters from the Islamic State (IS) militant group, which has seized large swathes of Iraq and neighbouring Syria.
Iraqi forces are providing training to local fighters at the Ain al-Asad base, and on Monday Iraqi Prime Minister Haider al-Abadi called for a "tribal revolution" against IS.
Meanwhile, IS said it had killed eight men in Iraq's Salahuddin province for allegedly co-operating with government security forces and international airstrikes, AP news agency reported.
A series of photos posted on a Twitter account used by the group showed the men kneeling and blindfolded beside a riverbank.
A provincial official speaking on condition of anonymity, however, contradicted the claim that the men were collaborators.
He told AP the men were army officers who had deserted prior to IS taking over parts of the province last year, and that they had not co-operated with Iraqi government forces.
At least 23 Iraqi troops and pro-government fighters have been killed in clashes with militants in the western province of Anbar, officials say.