A suicide squad using guns, grenades and a van packed with explosives targeted police and Pakistan's intelligence agency Wednesday, killing 30 and wounding 250 in an assault seen as revenge for the month-old army campaign against the Taliban in the Swat Valley.

The midmorning blast on a crowded street damaged an area nearly as big as a city block, mangling cars, spraying bricks in all directions and leaving behind a swimming pool-size crater. Most of the dead and injured were civilians.

Interior Minister Rehman Malik said militants were striking out because they were losing the fight with government forces battling to uproot extremists in the valley and the tribal areas in the northwest near Afghanistan.

"I believe that anti-Pakistan elements, who want to destabilize our country and see defeat in Swat, have now turned to our cities," Malik told reporters.

A group calling itself Tehrik-i-Taliban Punjab claimed responsibility for the bombing in a Turkish-language communique posted on Turkish jihadist Web sites Wednesday, saying it was related to the fight in Swat, according to SITE Intelligence Group. The claim could not be verified and the group's relationship to the Taliban was unclear.

Washington and other Western allies back the Swat campaign and are watching closely, seeing it as a test of the government's resolve to combat the spread of extremism in Pakistan.

The attack in Lahore, Pakistan's second-largest city, was far from the restive Afghan border region where the Taliban have established strongholds from which officials say they have launched attacks on Western forces in Afghanistan.

It was the third deadly assault since March in Lahore, the intellectual and cultural heart of the Punjab, the country's most populous province. Before March, it had largely escaped the violence that has plagued many parts of the country, but officials now fear militants may be choosing targets there to make the point that nowhere is beyond their reach.

Officials said three suspects had been detained.

Police and government officials described a coordinated assault on a compound that housed several government buildings, including a Punjab provincial government office, a police emergency call center and buildings housing the Inter-Services Intelligence agency, or ISI.

A white van pulled up in a narrow street separating the police and ISI buildings, police officer Sohail Sakheera told The Associated Press. Two gunmen stepped out from either side of the van, took cover behind concrete barriers protecting the buildings and opened fire, one on the ISI building, the other at the police building. A grenade was lobbed at the ISI building, he said.

A driver remained in the van.

Security guards returned fire and the fighting lasted several minutes, until one of the attackers was hit by ISI sharpshooters. Then a huge explosion erupted as the bomb was detonated.

"The moment the blast happened, everything went dark in front of my eyes," witness Muhammad Ali said.

The police building collapsed, crushing some officers and trapping others. Walls were sheared off the ISI building.

A crater several yards in diameter and several feet deep marked the exact spot of the blast, which provincial government official Sajjad Bhutta said was caused by 100 kilograms (220 pounds) of explosive.

The ceilings of several operating rooms in a nearby hospital fell in, injuring 20 people.

Raja Riaz, a senior provincial government minister, told reporters about 30 people were killed and at least 250 wounded. Fifteen police and several intelligence agents were among the dead, officials said. The remainder of the dead and the bulk of the wounded were civilians caught in the blast or hit by shrapnel.

The police building appeared to catch the brunt of the explosion, but one expert said the ISI headquarters was likely the main target. The complex is the main operations center for the ISI in Punjab.

The building also served as an ISI interrogation center, where operatives including Ahmed Omar Saeed Shaikh, who was later convicted in the murder of U.S. journalist Daniel Pearl in 2002, were held for a time, agency officials told the AP on condition of anonymity because they are not authorized to talk to the media.

U.S. officials and others in the past have accused the ISI of having links to militant groups, including the Taliban in Afghanistan. But the secretive agency has also been responsible for capturing and interrogating senior al-Qaida figures and collecting intelligence that helps the military's campaign against militants in the border region.

Mohammad Amir Rana, an expert on Pakistani militant groups with the Pakistan Institute for Peace Studies, said the ISI office would have been viewed as significant by the terrorists because it is the provincial headquarters for the agency.

"The message is very strong and that is that whoever is involved or have role in the ongoing military operation in Swat, they would be targeted," he said.

The army says at least 1,100 militants have been killed in a month of fighting in Swat, and that the Taliban is in retreat.

The military on Wednesday said troops had cleared militants out of Piochar, a village in a remote part of Swat that is the rear base for Taliban leader Maulana Fazlullah, and predicted that Mingora, the largest town in the valley, would be cleared of militants within three days.

The army on Wednesday invited refugees from the fighting to return to two villages, the first to be declared safe enough. More than 2 million refugees have fled, an exodus that aid officials warn could turn into a humanitarian disaster.