BAGHDAD - A thunderous blast tore through a vacant apartment building in northern Iraq on Wednesday, killing at least 17 civilians and wounding more than 130 in adjacent houses just minutes after the Iraqi army arrived to investigate tips about a weapons cache.

Rescue crews searched under toppled walls, collapsed ceilings and piles of debris tossed by the explosion that blew apart the empty building, which Iraqi authorities said was used by insurgents to stash weapons and bombs.

The hunt through the wreckage stretched for hours, raising the possibility the final casualty toll could climb. The huge blast went off just after the troops arrived, and no soldier was reported killed.

Instead, the explosion ravaged dozens of old homes and collapsed a three-story building in a mostly Sunni neighborhood in Mosul, about 225 miles northwest of Baghdad.

The blast also reinforced U.S. claims this week that Mosul -- Iraq's third-largest city -- is now the last urban center with a strong presence of al-Qaida in Iraq. American and Iraqi forces have been on the offensive against insurgents in and around Baghdad, but Mosul continues to be a center of gravity for al-Qaida in Iraq, according to the military.

Mosul, a major transportation hub with highways leading west to Syria and south to Baghdad, is considered a crucial conduit in the flow of money and foreign fighters to support the insurgency.

The city's internal tensions also provide fertile ground for al-Qaida among fellow Sunni Arabs. Extremists apparently seek to exploit ethnic tension between majority Sunnis and minority Kurds, who together form about 85 percent of Mosul's population of roughly 2 million.

Wednesday's explosion came shortly after the army received calls that insurgents were using the vacant building as a shelter and a bomb-making factory, according to Brig. Saeed al-Jubouri, a police spokesman.

That raised the possibility that insurgents may have tried to draw the soldiers into a trap.

But Brig. Abdul-Karim al-Jubouri, who heads security operations for the Mosul police, said authorities did not believe they were being lured. He said that -- if it were designed as a trap -- insurgents would have waited for security forces to get inside the building to kill as many of them as possible.

Also, he said, insurgents usually warn Sunni residents to leave before a bombing -- particularly if the intended targets are U.S. and Iraqi forces. On Wednesday, there was no advance word in the Sunni neighborhood.

"The insurgents used the building to store weapons and bombs, and it seems they blew up the building after learning that Iraqi soldiers had discovered their plans," Abdul-Karim al-Jubouri said.

The police spokesman al-Jubouri said 17 civilians were killed and 134 injured.

"Everything on the kitchen shelves fell on me, and I started to scream for help until my husband came and took me to the hospital," said 25-year-old Um Mohammed, who was treated for wounds to her head, legs and left hand.

Her husband, 32-year-old taxi driver Abu Mohammed, escaped with minor injuries to his hands.

"I was standing near my house behind the exploded building when a very loud blast took place, and the smoke covered the whole area," he said. "I was confused and went inside my house to search for my wife. Everything in the house was turned upside down. I saw my wife lying on the ground and I carried her to my car and headed to the hospital. What has happened is a disaster."

Attacks have persisted in recent months in northern Iraq even as violence has declined in Baghdad and other areas.

In a separate incident, a suicide car bomber targeted a police convoy near the northern city of Kirkuk, killing at least five civilians and wounding 11, police said.

In the capital, Baghdad, gunmen fired on Iraqi soldiers resting on the side of a highway, killing three and wounding at least one, according to police and the U.S. military. The attack in the heart of Baghdad provided a deadly example of the challenges facing the Iraqi forces as they work to take over security so U.S.-led troops can eventually go home.

Five militant Iraqi Sunni groups said in a joint statement posted on the Internet that they were stepping up attacks on American troops in Iraq in support of Palestinians in the Hamas-controlled Gaza Strip.

The statement announced the launching of what was described as the "Iraqi Resistance Campaign to Help Gaza" and accused President Bush and Israeli Prime Minister Ehud Olmert of responsibility for the deteriorating situation in the coastal strip.

In another development, Iranian President Mahmoud Ahmadinejad has accepted an invitation to visit Iraq, but no date has been set, the Iraqi Foreign Ministry announced. It would be the first visit to Iraq by a top Iranian leader since the Islamic revolution of 1979.

Iran had no immediate word on the visit.

The two Muslim neighbors fought a ruinous eight-year war in the 1980s that left an estimated 1 million people killed or wounded. Relations have improved since the 2003 ouster of Saddam Hussein's Sunni-led regime.