The attack illustrates the impunity with which militants in Iraq can strike even targets that should be highly secure.
Two militants, possibly wearing explosives-rigged vests or belts, seized the Samarra city council building on Tuesday morning with an unknown number of employees inside, security officials said.
Clashes broke out between the militants and security forces, and a suicide bomber detonated an explosives-rigged vehicle near police and anti-Al-Qaeda militia forces when they arrived at the scene.
The blast wounded 24 people, most of them police, a doctor and an officer said.
The doctor also said that the deputy head of the city council was wounded in the bombing.
The attack in Samarra follows a similar incident in Tikrit, another city in the central Salaheddin province, where militants detonated a car bomb and seized the city council headquarters on December 16.
Security forces ultimately freed the Tikrit hostages, but a city council member and two police were killed.
Violence in Iraq has reached a level not seen since 2008, when the country was just emerging from a brutal period of sectarian violence in which tens of thousands died.
More than 1,750 people have been killed in attacks and clashes in Iraq since January 1, according to AFP figures based on security and medical sources.