Baghdad, Iraq (CNN) -- Iraqi security forces stormed a Catholic church Sunday where gunmen suspected of having ties to al Qaeda were holding worshippers hostage, ending an hours-long standoff, police officials said Sunday.
Thirty-seven people were killed in the operation, including hostages, kidnappers and security workers, they said. At least seven of the victims were hostages, police officials said, while another 57 were wounded.
Eight suspects were arrested.
"All the marks point out that this incident carries the fingerprints of al Qaeda," Iraqi Defense Minister Abdul Qader Obeidi said on state television Sunday.
He said that most of the hostages were killed or wounded when the kidnappers set off explosives inside the church.
The Islamic State of Iraq later claimed responsibility for the attack through a statement posted on a radical Islamic website. The umbrella group includes a number of Sunni extremist organizations and has ties to al Qaeda in Iraq.
An American military spokesman said that as many as 10 hostages died and that between 20 and 30 people were injured in the operation. Seven Iraqi security workers and between five and seven suspected insurgents were also killed, said Lt. Col. Eric Bloom.
Survivors of the ordeal said they were about to begin Sunday night services when the gunmen entered the church, according to Martin Chulov, a journalist for the U.K.-based Guardian newspaper who was on the scene. About 50 people were inside the church at the time, and a priest ushered them into a back room, Chulov reported survivors said.
The U.S. military spokesman said that as many as 120 people were taken hostage.
At one point, one of the gunmen entered the room and threw an unidentified explosive device inside, causing casualties, Chulov said.
The gunmen seized the hostages after attacking the Baghdad Stock Market in the central part of the Iraqi capital, earlier Sunday, police said. Four armed men entered the nearby Sayidat al-Nejat church after clashing with Iraqi security forces trying to repel the stock market attack.
The gunmen were demanding that the Iraqi government release a number of detainees and prisoners inside Iraqi prisons, saying the Christian hostages would be freed in return, according to the police officials. Iraq's defense minister later said on state television that the kidnappers had demanded the release of a number of prisoners in both Iraq and Egypt.
Iraqi security forces sealed off the area surrounding the church, the officials said, and buildings were evacuated of civilians as a precautionary measure. At least 13 hostages, including two children, managed to escape ahead of the security operation, police said.
The Iraqi authorities ordered the attackers to release the hostages and to turn themselves in, warning that they would storm the church if they do not comply. A few hours passed quietly as military units took up positions outside the church, including several American units, said Chulov.
"Then all hell broke loose," he said. A firefight erupted and Chulov said he heard three to four large explosions. Later, he saw about 20 ambulances race away from the scene.
The American military spokesman minimized the role U.S. troops played in the operation.
"The U.S. only provided UAV (unmanned aerial vehicle) support with video imagery. As always we have advisers with the ISF (Iraqi security forces) command teams," said Bloom.
While the U.S. combat mission in Iraq officially ended earlier this year, some 50,000 American troops are expected to remain in the country until the end of 2011 to train, assist and advise Iraqi troops.
Two guards were killed and four others were wounded in the earlier attack on the stock market, according to the police officials.
The attackers also remotely detonated two car bombs outside the stock exchange, they said.
CNN's Mohammed Tawfeeq contributed to this story.