Police officials say the blast happened today when a group of soldiers searched a farmhouse in Garma, an area near the city of Fallujah, 65 kilometres west of the capital.
Minutes later, police say gunmen opened fire on arriving soldiers. Police say 24 soldiers were wounded.
The officials spoke on condition of anonymity as they weren't authorized to speak to journalists.
Al-Qaeda-inspired militants took control of Fallujah and parts of Ramadi in Anbar province in late December. The takeover came after security forces arrested a Sunni lawmaker sought on terrorism charges, then dismantled a year-old Sunni anti-government protest camp.