An improvised explosive device went off near a military vehicle, killing two soldiers and wounding three others, a senior security official told AFP.