By Muhanad Mohammed and Suadad al-Salhy
BAGHDAD (Reuters) - Iraqi security forces on Monday killed several suicide bombers and gunmen to rescue hostages seized by insurgents after they attacked a local government compound and a police station in Anbar province.
Two bombers detonated their explosives outside the compound in Baghdadi, 120 miles west of Baghdad, while attackers disguised in uniforms took about 20 people hostage before troops recaptured the complex.
In a separate attack on a police station in the town security forces thwarted an assault when they killed two bombers and detained one other.
The attacks underscored Iraq's still delicate security situation as the last U.S. troops prepare to withdraw at the end of 2011 more than eight years after the invasion that toppled Sunni dictator Saddam Hussein.
"The operation is over. Iraqi special forces stormed the compound all the attackers have been killed," Anbar provincial governor Qassim Mohammed told Reuters by telephone.
Violence in Iraq has fallen sharply since the height of sectarian strife in 2006-2007, but Sunni Islamist insurgents and radical Shi'ite militias still carry out daily attacks, assassinations and bombings.
Mohammed said four people, including a police chief, and three attackers were killed. But two police sources said as many of 13 people were killed during the attack and subsequent army action. Casualty figures often vary after attacks in Iraq.
Sources said three to seven bombers were involved in the compound attack.
At the compound the provincial council building where the hostages were held was partially destroyed in the siege.
"I saw a gunman covering his face with a mask as he was on the roof, then he disappeared. When the police and army arrived the gunmen were on the roof and at the windows," said local resident Jasim Khalaf.
Al-Qaeda's Iraqi affiliates, Islamic State of Iraq, though weakened by the loss of top commanders, often target local government buildings in an attempt to destabilize Prime Minister Nuri al-Maliki's power-sharing government.
Anbar, a vast mostly Sunni Muslim province in western Iraq, is the former stronghold of Iraq's al-Qaeda.
Suicide bombers killed four people last month in an attack on another government complex in Ramadi, also in Anbar.
The area has seen growing political tensions since September when gunmen killed 22 Shi'ite pilgrims there, triggering angry exchanges between tribal leaders from Anbar and the mainly Shi'ite city of Kerbala nearby.
Iraqi and U.S. officials say local armed forces are able to contain the stubborn insurgency. But the government is debating whether to ask some American soldiers to stay on as trainers to help the Iraqi military fill gaps in its capabilities.
About 44,000 U.S. troops remain in Iraq after ending combat operations last year. They are mostly advising and assisting Iraqi forces as they pack up before a year-end deadline for them to leave the country.
(Additional reporting by Fadhel al-Badrani and Kareem Raheem; Writing by Patrick Markey; Editing by Matthew Jones)