The blast struck around midday as troops were leaving the base in Taji, 20 kilometers (12 miles) north of the capital, police said. Twenty-two soldiers were among the dead, and several vehicles were damaged, they said.
The casualty toll was high because the attacker blew up the car while large numbers of soldiers were walking to and from a parking area for waiting minibuses that take them to work, officials said.
There was no immediate claim of responsibility, though suicide car bombings are a favorite tactic of Sunni militant groups such as al-Qaida.
Insurgents frequently target members of the country's security forces in an effort to undermine confidence in the Shiite-led government. Although violence has ebbed in Iraq since the height of the insurgency, attacks still occur frequently.
Officials said many of the wounded were soldiers. They warned the death toll could rise further because several of the injuries were serious.
Tensions at the scene remained high hours after the blast. Police and soldiers cordoned off the area and prevented journalists from approaching. Two cameras were damaged when a scuffle broke out between security forces and journalists who were trying to reach the attack site, a police official said.
Hospital officials confirmed the casualties. All officials spoke on condition of anonymity because they were not authorized to talk to the media.
The attack was the deadliest in Iraq in more than a week. On Oct. 27, insurgents unleashed a string of bombings and other attacks around the country that left at least 40 people dead.
It was the second bombing in Taji in less than 24 hours. On Monday, police said a car bomb struck an army patrol not far from the site of Tuesday's blast, wounding eight people. Another bombing Monday near an outdoor market in a Shiite neighborhood on Baghdad's outskirts killed four.
Also Tuesday, Iraq's Cabinet voted to do away with a major social safety net program and instead provide cash payments directly to citizens, government spokesman Ali al-Dabbagh said.
The reform would bring an end to food ration cards that many Iraqis use to buy basic, highly subsidized foodstuffs such as flour and rice. Instead, the government plans to begin paying out 15,000 dinars ($12.50) monthly and will set the price of flour starting in March.
In Iraq's north, the president of the country's self-ruled Kurdish region urged Kurds in neighboring Syria to stay united and not let political differences deteriorate into violence.
The comments by Massoud Barzani, posted Monday evening on the regional government's website, point to growing concern in Iraq that infighting among Syrian Kurds could complicate that country's civil war and risk destabilizing Iraq's Kurdish region. Syria's Kurds have been solidifying control over territory where they live during the tumult of the conflict.
Over the summer, Barzani brokered an agreement between the rival Kurdish Democratic Union Party and the Kurdish National Council, the main Kurdish umbrella group, to jointly control Kurd-populated areas in Syria.
Associated Press writers Bushra Juhi, Sinan Salaheddin and Sameer N. Yacoub contributed to this report.