There was no immediate claim of responsibility but Islamic State militants have carried out a string of attacks there since they lost control of their Iraqi territory in 2017 and reverted to hit-and-run insurgency tactics.
The car exploded as soldiers were inspecting it on a road leading to Anbar's Qaim district, 300 km (185 miles) west of Baghdad and close to the border with Syria.
"The search for the terrorist elements which committed this criminal action is ongoing," the military said in a statement.
Iraq reopened its Qaim border-crossing with Syria in September after eight years of closure. Qaim borders the Syrian town of Albukamal, which was also an Islamic State stronghold.Islamic State seized vast swathes of land in both Iraq and Syria in 2014, declaring a caliphate across both countries. Iraq declared victory over the group in 2017 and the militants lost their last territory in Syria earlier this year.