Iraq's military says militants have ambushed a convoy of off-duty soldiers near a town in the country's sprawling western desert, killing at least 10 and wounding 20.

Maj. Emad al-Dulaimi said on Monday that the attack took place the night before near the town of Rutba. He says the militants were armed with assault rifles and rockets.

It wasn't immediately clear who carried out the attack but al-Dulaimi blamed the Islamic State group.

IS has carried out many similar attacks targeting Iraqi forces in the past months to detract from the ongoing battle between Iraqi forces and Islamic State militants in Mosul.

Rutba lies about 390 kilometers west of Baghdad in the country's vast Anbar province. It's the last sizable town on the way to the border with Jordan.