The vehicle that was detonated in central Kirkuk had been painted to make it look like a police car, and the militants who sought to seize the compound were dressed as policemen, witnesses said.
The attack shattered a relative calm in Iraq, which has been grappling with a political crisis pitting Prime Minister Nuri al-Maliki against his erstwhile government partners amid weeks of ongoing protests calling for him to resign, all less than three months before key provincial elections.
No organization immediately claimed responsibility for the attack, but Sunni militants including al-Qaeda's front group in Iraq frequently target security forces and government targets in a bid to destabilize the country and push it back towards the sectarian bloodshed that blighted it from 2005 to 2008.
The initial suicide car bomb was set off during morning rush hour, and was quickly followed by at least three gunmen dressed in police uniforms, armed with hand grenades and suicide vests, bursting through the main gate of the Kirkuk police compound in the direction of the headquarters building.
They threw multiple grenades as they sought to reach the building, but were killed before they could get there, witnesses said.
Brigadier General Natah Mohammed Sabr, the head of Kirkuk city's emergency services, put the toll at 30 dead and 70 wounded. Among those hurt was Brigadier General Sarhad Qader, commander of police forces for areas surrounding the city.
In addition to the casualties, the attack caused massive damage to nearby buildings and shops, according to an AFP journalist at the scene.
The massive explosion also killed people in nearby buildings. Mohammed Aziz, who works in an office building adjacent to the police headquarters, said at least two of his colleagues died in the blast.
"It seems they came to free prisoners, because they came in a very organized way," General Qader, who suffered back wounds but is now in stable condition, told AFP from a hospital in Arbil north of Kirkuk.
"But the police clashed with them, and we killed all of them."
Police largely cut off traffic in the city center and evacuated offices and businesses in the area. They managed to defuse one of the attackers' suicide vests, but were still working to disarm two more.
Kirkuk, an ethnically mixed city 240 kilometers (150 miles) north of Baghdad, lies at the heart of a swathe of disputed territory claimed by both the central government and Iraq's autonomous northern Kurdish region.
Also on Sunday, in three separate attacks north of Baghdad, in Tarmiyah and Baquba, two anti-Al-Qaeda militiamen were killed and three people were wounded, officials said.