LAHORE, Pakistan - Gunmen attacked a police headquarters in the Pakistani city of Lahore on Wednesday, setting off a car-bomb that killed at least 22 people in what the government said was revenge for an offensive against the Taliban.

There was no claim of responsibility for the attack, which wounded nearly 300 people and caused extensive damage. It came after warnings of strikes in response to the army's attack on militants in the Swat region in the northwest.

The blast also hit after General David Petraeus, head of the U.S. Central Command, was in Islamabad for meetings on Tuesday with government and military leaders.

The United States needs Pakistani action against militants to help defeat al Qaeda and disrupt support for the Taliban in Afghanistan. It has welcomed the Swat offensive.

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

The bomb, which officials said was a suicide attack, brought down a government ambulance service building and damaged a nearby office of the military's main intelligence agency.

Security officials said a senior intelligence officer was killed and the agency office might have been the target.

Top city official Khusro Pervez Khan said 22 people had been killed and 285 wounded. Rescuers were searching through the rubble and the toll could rise, another city official said.

Just before the blast two men got out of a car and fired at police guards at the gate, provincial Law Minister Rana Sanaullah told reporters, adding several suspects were later detained.

Witnesses said about four gunmen started firing.

ON THE RUN

Militant violence has surged in Pakistan since mid-2007, with numerous attacks on the security forces, as well as government and Western targets.

Officials had warned militants might launch attacks in retaliation for the offensive in Swat, where the military says about 15,000 soldiers face 4,000-5,000 militants.

The Wednesday blast was the fifth since fighting in the region intensified in late April.

President Asif Ali Zardari called top officials to a meeting to review security, and said the militants were on the run and were trying to create panic, his office said.

Lahore is capital of Punjab, Pakistan's most populous and prosperous province. The country's second biggest city is also traditionally home to top bureaucrats and senior military brass.

The city has seen several bomb attacks over the past couple of years, but it felt much safer than other parts of the country until March when militants launched two brazen assaults.

Attackers stormed a police academy in the city on March 30, killing eight recruits. That attack, claimed by Pakistani Taliban leader Baitullah Mehsud, came weeks after gunmen attacked Sri Lanka's cricket team, killing six police guards and a driver.

In Swat, soldiers had made considerable progress in securing the main town of Mingora which should be cleared in two or three days, the military said, adding 12 militants and one soldier had been killed in the previous 24 hours.

The government says about 1,100 militants and about 60 soldiers have been killed, although there has been no independent confirmation of those estimates.

The offensive has sparked an exodus of 2.3 million people, according to provincial government figures, and the country faces a long-term humanitarian crisis which could undermine public support for the fight against the Taliban.

The military said the displaced could move back into much of the Buner region, to the south of Swat, which the Taliban, emboldened by a February peace pact, seized in April to the alarm of the government and Western allies.

The military also said the Mohmand region on the Afghan border had been cleared and displaced people could move back.

Share dealers said the market got an early boost from a Supreme Court ruling on Tuesday that cleared the way for former prime minister Nawaz Sharif to seek election, and removed a cause of political uncertainty.

While struggling to improve security, the government has also been trying to revive an economy being kept afloat by a $7.6 billion International Monetary Fund loan agreed in November.