LAHORE, Pakistan - The United States has evacuated all non-emergency staff from its consulate in the Pakistani city of Lahore, citing "specific threats" amid a worldwide alert over Al-Qaeda intercepts.
The US State Department also reiterated a longstanding warning to US citizens to avoid all non-essential travel to Pakistan, in a statement issued late on Thursday Washington time.
The move came as two fresh attacks, one on the edge of the heavily-guarded capital, marred the start of the Islamic festival of Eid al-Fitr and highlighted the parlous security situation in the nuclear-armed nation.
The restive southwestern city of Quetta, focus of a surge in sectarian bloodshed, suffered its second deadly attack in two days, while a security guard was killed in a foiled suicide bombing at a Shi'ite mosque on the outskirts of Islamabad.
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 had struck at a police funeral in the city, killing 38 people in an attack claimed by the Taleban.
Violence has continued unabated in the country since its new government took office in June.
The closure of the US consulate in Pakistan's second-largest city and cultural capital came amid heightened security measures in the capital Islamabad, where police and soldiers were highly visible on the streets.
Police officer Nasir Mehmood told AFP a suicide bomber tried to attack a Shi'ite mosque in Bhara Kahu on the city's northeastern edge, but was intercepted by a security guard.
"The guard opened fire on the bomber as he entered the mosque and killed him. He could not explode his jacket," Mr Mehmood said.
Another police official, Majeed-ur-Rehman, said a guard was killed in an exchange of fire with the bomber before the attacker was shot dead.
Pakistan has been gripped by a surge in sectarian violence in recent years, mostly by majority Sunnis against minority Shi'ite communities in Quetta.
The US State Department said it ordered the pullout of non-emergency US government personnel from the Lahore consulate as of Thursday.
"The Department of State ordered this drawdown due to specific threats concerning the US Consulate in Lahore," it said in a statement.
Ms Meghan Gregonis, spokeswoman for the US embassy in Islamabad, said the evacuation was not linked to a terror threat that prompted the closure of 19 diplomatic missions in the Middle East and Africa.
"We received information regarding a threat to our consulate in Lahore. As a precautionary measure we have undertaken a drawdown for all but emergency personnel in Lahore," she told AFP.
The US embassy and consulates in Karachi and Peshawar were closed on Friday for the Eid public holiday but are expected to open again on Monday, she said.
The Lahore mission was likely to remain closed and there was currently "no indication" of when it might reopen.
Despite Pakistan's fractious alliance with the United States in the "war on terror", anti-American sentiment runs deep in the country, fuelled in part by the CIA's drone strikes against militants in the tribal northwest.
Washington maintains the strikes are an important weapon in the fight against Taliban and Al-Qaeda extremists, but Pakistan denounces them publicly as a violation of sovereignty.
US diplomatic missions have been the target of violence in the past.
A suicide car bomber rammed a US diplomatic vehicle in the northwestern city of Peshawar last September, killing two people - at least the third time the mission and its staff had been attacked by Taliban and Al-Qaeda-linked militants since April 2010.
This week's closure of US missions mainly in the Arab world was reportedly ordered because of intercepted messages from Al-Qaeda leader Ayman al-Zawahiri to the terror network's Yemeni franchise.
The alert focused on Al-Qaeda in the Arabian Peninsula, a Yemen-based group which has made several attempts to attack the United States in recent years and is widely seen as the group's most sophisticated offshoot.
On Tuesday, the US and other Western nations withdrew diplomatic staff from Yemen, where the Americans are fighting a drone war against the Al-Qaeda regional affiliate.
US officials have said Al-Qaeda's core leadership in Afghanistan and Pakistan has been decimated in recent years. They cite the 2011 killing of Osama bin Laden and the killing of several senior operatives in US drone strikes.