The suicide bomber slammed a car packed with explosives into the gate of a military base in Taji, some 20 kilometres north of Baghdad, killing at least eight soldiers, police officials said.
The attack took place as dozens of soldiers were departing the facility for weekend leave. The officials said 21 troops were wounded in the bombing.
In a separate incident, an explosion in a booby-trapped house in a village recently retaken from Islamic State militants killed four soldiers and two Shiite militiamen.
At least 14 troops were wounded.
Samarra is 95 kilometres north of Baghdad. The city and surrounding areas have been under near-constant attack by the Islamic State group, which captured large swaths of western and northern Iraq last year.
Medics at nearby hospitals confirmed the casualty figures. All of the officials spoke on condition of anonymity because they are not authorized to brief the media.
