It the latest example of the danger facing diplomats operating in volatile parts of the Muslim world and comes at a time when Pakistan is suffering a terrorist attack almost every day.

It also followed an al-Qaeda threat to US diplomatic posts in the Middle East and North Africa that American officials said was unrelated to the threat in Pakistan.

US consulates suffered attacks in different parts of Pakistan in the past, and Washington is still scarred by the memory of the attack last year on a diplomatic post in Benghazi, Libya, that killed Ambassador Chris Stevens and three other Americans.

Non-essential staff from the eastern Pakistani city of Lahore were being moved to the capital, Islamabad, after a specific threat to the consulate there, said Meghan Gregonis, embassy spokeswoman. Emergency personnel will stay in Lahore, she said, and the consulate will remain closed indefinitely.

“We received information regarding a threat to the consulate,” she told AP. “As a precautionary measure, we are undertaking a drawdown of all except emergency personnel.”

The Pakistani Taliban carried out a car bomb and grenade attack against the American consulate in the northwest Pakistani city of Peshawar in 2010 that killed four Pakistanis. The consulate in the southern city of Karachi has also been attacked several times.

Earlier this week, 19 US diplomatic outposts in 16 countries in the Middle East and Africa were closed to the public from Saturday.

Meanwhile, the Pakistani capital Islamabad has been on high alert because of intelligence received by the Pakistani government that militants were planning attacks on targets in the city, including the airport and parliament.

In Quetta, gunmen shot dead nine worshippers as they left Friday morning prayers for Eid, which marks the end of the holy month of Ramadan.

A day earlier, a suicide bomber struck a police funeral in the city, killing 38 people in an attack claimed by the Taliban.

Violence has continued unabated in the country since its new government took office in June. There have been 55 attacks in the country in the past 60 days, its most intense blitz in several years.