Pakistani police defused a large bomb less than five minutes before it was timed to detonate outside the U.S. Consulate on Monday, averting a devastating terrorist attack two days before Secretary of State Colin Powell (search) visits this country.

The close call came as President Gen. Pervez Musharraf (search), a top Washington ally, said a Libyan member of Al Qaeda (search) was behind two bombings he narrowly escaped in December. Musharraf vowed to purge Pakistan of hundreds of foreign terrorists.

It was not clear who was behind the thwarted attack on the consulate in Karachi — Pakistan's largest city of 14 million people and scene of a wave of anti-Western bombings since the Sept. 11, 2001 attacks — but suspicions immediately focused on Islamic extremists blamed for previous blasts.

Pakistan's military leader has enraged radicals through his backing of the U.S.-led war on terrorism. Musharraf switched allegiance in the days after Sept. 11, withdrawing what had been strong support for Afghanistan's hardline Taliban militia government and working with Washington on engineering its ouster.

"The man or men who left this van near the U.S. Consulate building wanted to blow it up," Pakistani Information Minister Sheikh Rashid Ahmed told The Associated Press in Islamabad.

The Pakistani government and U.S. Embassy said Powell, currently in India, would arrive Wednesday for a two-day visit of Pakistan as planned. Powell's itinerary does not include this southern city.

Pakistani police, using footage from surveillance cameras at the consulate, said a man dressed in a traditional Pakistani tunic parked a van outside the heavily guarded consulate at 7:14 a.m., and fled in a following car after he was challenged by a paramilitary guard.

Inside the van, police bomb disposal experts found a plastic water tank containing about 200 gallons of a liquid explosive mix — including the combustible fertilizer chemical ammonium nitrate — attached to detonators and a timer. They moved the bomb to a safe location and defused it.

A police investigator, Qazi Chand, told AP that "only four and a half minutes were left for the bomb to detonate when bomb disposal experts successfully defused it." One of the experts suffered a slight injury to his hand as he removed the timer and detonator from the tank.

Another investigator, Fayyaz Leghari, said it was first time he had encountered such a liquid bomb, which would have caused a huge fireball if it had gone off. "Previously, the terrorists had used solid explosive material," he said.

The van used in the attempted bombing had been seized from a 17-year old Pakistani student late Sunday in Karachi. Police released a sketch of one of two men wanted in the armed robbery.

Andrew Steinfeld, the counselor for public affairs at the U.S. Embassy in Islamabad, said police defused the bomb before most of the two dozen American and Pakistani staff had arrived for work. The consulate was consequently shut for the day, and it wasn't immediately clear when it would reopen.

Hundreds of policemen and paramilitary troops cordoned off the consulate — scene of at least two previous attacks.

In June 2002, a homicide bomber blew up a truck in front of the U.S. Consulate, killing 14 Pakistanis. In February 2003, a gunman opened fire on a police post guarding the consulate, killing two policemen and wounding at least five other people.

Four men, who allegedly belonged to the outlawed Islamic militant group Harkat-ul-Mujahedeen Al-Almi, were convicted last year for the June 2002 bombing. Two were sentenced to death by hanging, and two to life in prison. The group has been linked to the Al Qaeda terror network.

On Monday, Musharraf acknowledged for the first time that 500 to 600 foreign terrorists were sheltering in Pakistan's tribal areas bordering Afghanistan, where Pakistan has deployed some 70,000 troops to weed out fugitives. He vowed to drive the foreigners out by force if they did not surrender.

"You give any name to them, Al Qaeda or not, but I will say we will not allow these foreigners to stay in our tribal areas and create problems for us," the president said in a speech to tribal elders in the northwestern city of Peshawar.

"We will not allow them to get training in our tribal areas, store explosives and go back to Afghanistan for killing their Muslim brothers."

Musharraf went on to accuse a Libyan member of Al Qaeda — whom he did not name — as being behind two assassination attempts that he narrowly escaped 10 days apart in December near the capital, Islamabad. No one was hurt in the first attack, but 16 people were killed in the second.

He said the Libyan paid $25,000 to $35,000 to a Pakistani who recruited Islamic militants in the attacks.

The president has previously said Al Qaeda could have played a part, but this was the first time he explicitly identified a suspect in the attacks. He promised to publicize the so-far secret investigations into the bombings, and show the suspects' "interviews" on television.