Hours later, guerrillas killed three policemen on patrol close to neighbouring Samarra, and shot dead a member of the city's governing council as well as his driver and bodyguard.
A National Guard officer said the car bomb killed 25 soldiers on the way to their posts. Relatives wept over the men's bodies at a local mosque. A civilian bystander also died in the blast.
But in a sign that the campaign of intimidation was having an effect, an election organising committee in the northern city of Baiji quit en masse after receiving death threats.
The committee quit on Sunday after some members received death threats, the committee's president said.
Earlier on Sunday, guerrillas in the nearby town of Sharqat ordered municipal workers out of a local government building due to serve as a polling centre, before blowing it up.