Iraqi forces ended a hostage-taking at a Baghdad government building killing four militants on Thursday, as nationwide violence took January's death toll past 900 with elections looming.
The brazen assault on a building in the northeast of the capital came as security forces grapple with intensifying violence and an extended standoff with anti-government fighters in the western province of Anbar.
It is likely to raise fresh concerns about the capabilities of Iraq's security forces amid fears the April 30 general election could be partially delayed, as was the case for provincial elections in April 2013.
Six militants wearing suicide vests initially attempted to storm the building, which houses offices of a state-owned firm, by blowing up a minibus rigged with explosives at the main gate, police at the scene said.
When the explosion did not go off, one of the attackers blew himself up to clear the way for his fellow militants, followed by a second bomber who set off his vest at an inner gate.
The four remaining fighters then took hostages in the building for several hours before they were eventually killed by security forces, interior ministry spokesman Brigadier General Saad Maan said.
At least two people were killed in the attack overall -- a policeman at the main gate and an employee responsible for monitoring security cameras in the main building, Maan said. Eight more were wounded.
A police colonel and an interior ministry official confirmed the account and the toll.
"At the time of the attack, the employees in the building behaved very wisely and shut all their doors," Maan told AFP. "They kept all the employees inside.
"The whole operation is now finished, everything is under control."
The blood of the first guard killed in the initial suicide bombing, as well as pieces of the attacker's flesh and parts of his suicide vest, were still visible on the ground when AFP journalists arrived at the scene after the hostages were freed.
Mobile phone footage shown to AFP by police officers indicated the inside of the building was badly damaged by firefights and explosions.
Security forces had sealed off the surrounding area, which is home to other government offices, including the transport ministry and a human rights ministry building.
Signup to our newsletter and follow us on Facebook and Twitter!
Three Baghdad bombings
Elsewhere in the Iraqi capital, three bombings near markets and a restaurant in the Shiite-majority neighbourhoods of Kasra, Shaab and Talbiyah killed 10 people and wounded 32, officials said.
They struck hours after car bombs ripped through Baghdad Jadidah, Shuala and Talbiyah, which are predominantly Shiite, leaving nine people dead on Wednesday evening.
Attacks on Wednesday also hit the capital's outskirts, as well as the northern cities of Mosul and Tuz Khurmatu, killing seven others.
Violence has killed at least 917 people in Iraq this month, more than three times the toll for January 2013, according to an AFP tally based on reports from security and medical officials.
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 (ISIL) have mounted similar attacks in Baghdad.
On Wednesday, Iraqi officials published a rare photograph purportedly of ISIL leader Abu Bakr al-Baghdadi, the first of its kind released by an official source.
The black and white picture, which provides a rare glimpse of the militant commander accused of ordering the killings of countless Iraqis, shows a balding man with a beard wearing a suit and tie.
The latest bloodletting comes as security forces are locked in battles with militants, some of them affiliated with ISIL, in Anbar, a mostly Sunni Arab desert region west of Baghdad that shares a border with Syria.
It is the first time militants have exercised such open control in Iraqi cities since the peak of violence that followed the US-led invasion of 2003.
The standoff has prompted more than 140,000 people to flee their homes, the UN refugee agency said, describing it as the worst displacement in Iraq since the peak of sectarian conflict in 2006-2008.
Washington has provided Baghdad with weaponry to help it combat militants and also plans to sell it 24 Apache attack helicopters.
But diplomats and analysts say the Shiite-led government must do more to reach out to the disaffected Sunni Arab minority in order to undercut support for militancy.