At least 18 people were killed in an assault by militants on a building belonging to the Iraqi Ministry of Transportation on Thursday, a senior security source told Reuters.
Security forces regained control of the building after six suicide bombers stormed it and took several hostages, four of whom were killed.
Earlier, a police officer and interior ministry official said eight gunmen stormed a building occupied by a state-owned company run by the transport ministry, and took a number of people hostage.
"A terrorist group infiltrated the company, which is next to our building," said Kamal Amin, spokesman for the human rights ministry, which has offices next door.
"For the safety of our employees, we have taken all necessary security measures and we have evacuated our building."
Death toll for January passes 900
Renewed violence in Iraq has pushed the death toll for January past 900 with elections looming in three months.
Elsewhere in the Iraqi capital on Thursday, bombings near a market and a restaurant in the Shiite-majority neighbourhoods of Kasra and Talbiyah killed six people, security and medical officials said.
They struck just hours after several car bombs ripped through Baghdad Jadidah, Shuala and Talbiyah, all of which are predominantly Shiite, leaving nine people dead on Wednesday evening.
Attacks on Wednesday also hit the outskirts of the capital, as well as the northern cities of Mosul and Tuz Khurmatu, killing seven others.
No group claimed responsibility for the ministry assault and the bombings, but Sunni militants affiliated with the Al-Qaeda-linked Islamic State of Iraq and the Levant have in the past mounted similar attacks in Baghdad.
Weapons from Washington
The brazen assault on the ministry building comes as security forces grapple with intensifying violence and an extended standoff with anti-government fighters in western Anbar province.
Washington has provided Baghdad with additional weaponry to help it combat militants and plans to sell Iraq 24 Apache attack helicopters as well, but diplomats and analysts say the Shia-led government must do more to reach out to the disaffected Sunni community in order to undercut support for militancy.