A bomber detonated his explosives at around 8am (0400 GMT) on Thursday outside an army recruiting post in al-Muthana, a former airfield in the centre of Baghdad, killing 15 people, the official said.
Nine police officers were shot to death in their squad cars in two attacks.
Armed men opened fire on two police cars, killing six police officers, in the south of the capital at about 6am (0200 GMT). The attackers then burned the cars.
An Iraqi journalist, Muhammad Abd Allah, told Aljazeera that the attack targeted two patrols of Iraqi police in the al-Saydiya district south of Baghdad.
In another attack, armed men opened fire on two police cars in eastern Baghdad, killing three police officers. Three others managed to flee.
Abd Allah said fighters threw a bomb into the second vehicle but the police prevented the bomb from detonating.
In addition, a guard was killed in a car bomb attack on the home of a deputy interior minister in the capital, Abd Allah said.
Major-General Hikmat Musa Salman was not hurt in the attack as he was not at his home when the car bomb exploded in the al-Kafaat neighbourhood west of Baghdad.
Bodies of Iraqi policemen laid
out after Thursday's attacks
On Thursday Wafiq al-Samarrai, security adviser to the Iraqi president, spoke to Aljazeera from Baghdad on the upsurge in violence. "This is not surprising - what is happening was expected. The current conditions are a passing phenomenon," he said.
The new Iraqi government and the new president are supporting and monitoring the various institutions and taking follow-up action, al-Samarrai said.
The new interior minister is fearlessly and aggressively carrying out his duties, he said, and the Iraqi army, police and other security organisations are steadily improving in terms of numbers and equipment.
"All of the perpetrators of last week's terrorist and suicide attacks failed to reach their targets," al-Samarrai said.
"None of the suicide bombers could penetrate the security barricades, checkpoints and offices, and so were forced to carry out attacks in a haphazard manner, picking on random targets like security patrols."
An injured child who was caught
in one of Thursday's gun battles
Al-Samarrai said the frequency of attacks had actually decreased if one considered the overall picture, but admitted that there had been a surge in violence of late.
"The Iraqi Al-Sabah newspaper has reported that differences of opinion have cropped up between Baathists and Saddamists. So this is a potential turning point."
Al-Samarrai added that he had information that many armed groups in Anbar province and Falluja town had contacted foreign and Iraqi forces with a view to joining the political process.
These are positive developments, he said. "We should not take a narrow or dim view of the situation."