The action came amid a flurry of deadly militant attacks in Pakistan. It also followed an al-Qaida threat to U.S. diplomatic posts in the Middle East and North Africa that American officials said was unrelated to the situation in Pakistan.
U.S. consulates have been attacked previously in different parts of Pakistan, and Washington is still scarred by the memory of the attack last year on a diplomatic post in Benghazi, Libya, that killed U.S. Ambassador Chris Stevens and three other Americans.
The U.S. is shifting nonessential staff from the eastern Pakistani city of Lahore to the capital, Islamabad, after a specific threat to the consulate there, said U.S. Embassy spokeswoman Meghan Gregonis. Emergency personnel will stay in Lahore, and embassy officials do not know when the consulate will reopen, she said.
"We received information regarding a threat to the consulate," said Gregonis. "As a precautionary measure, we are undertaking a drawdown of all except emergency personnel."
She did not provide any details on the nature of the threat or the evacuation of U.S. personnel, including exactly when it occurred. The consulate in Lahore was already scheduled to be closed for the Muslim holiday of Eid al-Fitr from Thursday through Sunday.
The Pakistani Taliban carried out a car bomb and grenade attack against the U.S. 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.
The personnel drawdown at the Lahore consulate was precautionary and wasn't related to the recent closures of numerous U.S. diplomatic missions in the Muslim world because of a threat from al-Qaida, said two U.S. officials, speaking on condition of anonymity because they were not authorized to discuss the order.
Earlier this week, 19 U.S. diplomatic outposts in 16 countries in the Middle East and Africa were closed to the public through Saturday and nonessential personnel were evacuated from the U.S. Embassy in Yemen after U.S. intelligence officials said they had intercepted a recent message from al-Qaida's top leader, Ayman al-Zawahiri, about plans for a major terror attack.
None of the consulates in Pakistan or the U.S. Embassy in Islamabad were affected by the earlier closures.
On Thursday, the State Department advised U.S. citizens not to travel to Pakistan, saying the presence of several foreign and indigenous terrorist groups posed a potential danger.
The country has faced a bloody insurgency by the Pakistani Taliban and their allies in recent years that has killed over 40,000 civilians and security personnel, and is also believed to be home base for al-Zawahiri, although his exact whereabouts are unknown. Al-Qaida's founder, Osama bin Laden, was killed in a raid by U.S. commandos in the Pakistani city of Abbottabad, about a two hour drive north of Islamabad.
Most militant attacks in Pakistan have been in the northwest and southwest along the border with Afghanistan.
Gunmen killed six people and wounded 15 others Friday in an attack on a former lawmaker outside a mosque in Quetta, the capital of southwest Baluchistan province, said police officer Bashir Ahmad Barohi. The lawmaker escaped unharmed, and no one has claimed responsibility for the attack. A day earlier, a Taliban suicide bomber killed 30 people at a police funeral in Quetta.
Pakistan's major cities, including Lahore, have also experienced periodic attacks.
A powerful bomb exploded at a busy market street in Lahore in early July, killing at least four people and wounding nearly 50.
Lahore is considered Pakistan's cultural capital and has a population of at least 10 million people.
A CIA contractor shot to death two Pakistanis in Lahore in January 2011 who he said were trying to rob him. The incident severely damaged relations between Pakistan and the U.S. The contractor, Raymond Davis, was released by Pakistan in March 2011 after the families of the victims were paid over $2 million.
Islamabad has also been under high alert in recent days because of intelligence received by the Pakistani government that militants were planning attacks on key targets in the city, including the airport and parliament - although there was no indication that the militants were planning attacks on U.S. targets in the capital.
The threat in Islamabad followed a Taliban attack on a prison in the northwest at the end of July in which the group freed around 250 prisoners, including over three dozen suspected militants.
On Friday, guards at a Shiite Muslim mosque on the outskirts of Islamabad shot and killed a would-be suicide bomber before he could set off his explosives, police officer Abid Hussain said. The attacker opened fire on the guards, critically wounding two of them and killing a third before he was killed, said another police officer, Mohammed Riaz.
The identity of the attacker was not known, but radical Sunni Muslim militants in Pakistan have carried out multiple attacks on Shiites, who they consider heretics.
Associated Press writer Abdul Sattar in Quetta, Pakistan, and Matthew Lee in Washington contributed to this report.