A top US diplomat was ambushed yesterday by gunmen who opened fire on her armour-plated vehicle in Pakistan's volatile north-western city of Peshawar. Lynne Tracy, America's consul-general in the city, was unhurt, as were the other two US consular employees who were travelling with her.

The assault comes as Pakistani security forces become further involved in a battle with Taliban militants in two areas that border Peshawar: the Bajaur tribal area and the valley of Swat. The extremists have vowed revenge, carrying out two suicide bomb attacks last week, although there was no claim of responsibility for the attack on Tracy.

Tracy, who is America's "principal officer" in Peshawar, was attacked just after she was driven out of her home in the university area, the prime residential area in the city. Two gunmen, armed with AK-47 automatic weapons, reportedly leapt from a Toyota Land Cruiser, which blocked her vehicle's path, and sprayed hundreds of bullets. However, the bullets either did not hit or bounced off the armour. Tracy's chauffeur quickly reversed the vehicle back into her home, knocking over a rickshaw whose driver had to be treated in hospital.

"The people never pursued her," said Malik Naveed Khan, chief of the North-West Frontier Province police. "It's early to say [who was behind the attack], we are looking into all aspects." The only damage to Tracy's vehicle was to its engine, which was hit by bullets which bounced off the street, Khan said.

The US consulate in Peshawar is a fortress-like building, surrounded by rings of barbed wire, about a 20-minute drive from Tracy's home. But the consul-general's house is a regular-looking home that does not appear to have any special protection.

Lou Fintor, a spokesman for the US embassy in Islamabad, confirmed that a "security incident" had taken place in Peshawar involving a consulate vehicle in which no employees were injured, but he would give no further details. "The consulate is open and operating normally," Fintor added.

Around 100 Americans and Pakistanis work at Peshawar consulate, making it a potentially tempting target for extremists. From there and the embassy in Islamabad, which both have a large CIA presence, militant groups operating in Pakistan are monitored, as are the activities of the Pakistan state.

Peshawar is located on the edge of the lawless tribal area of Pakistan, which is a base for Taliban and al-Qaida elements operating in neighbouring Afghanistan. In 2006, a suicide car bomb attack on the US consulate in Karachi killed an American diplomat. Earlier this year, a car bombing at the Danish embassy in Islamabad killed five Pakistanis.

Rustam Shah, an analyst who was formerly the Pakistani ambassador to Afghanistan, said that anger over the Pakistani military's operations against militant groups would also be taken out on US interests.

"They [the militants] believe this force has become a stooge, promoting someone else's agenda," said Shah. "They regard them as America's mercenaries."