A U.S. Embassy employee was released after being held for questioning in Pakistan on Tuesday when airport security officials discovered bullets in his luggage, police said.
The American was about to to fly from the northwestern city of Peshawar to the capital Islamabad when he was taken into custody, said Tahir Ayub, a senior police superintendent.
He was released after four hours when officials from the U.S. consulate in Peshawar produced documents to show the man worked at the consulate.
"We have been directed to release him as he had diplomatic immunity," Ayub told NBC News.
"He's been released to the consulate," a U.S. official in Islamabad said. "He's at the consulate now."
The American is an embassy employee usually based in Islamabad but was temporarily assigned to the Peshawar consulate, the official said.
Police officers had earlier said they would hold the man until his identity had been verified by the foreign office in Islamabad and a U.S. official in the capital had said the embassy was looking into the details of the reports.
"He has diplomatic status," the official said. "We're in contact with Pakistani authorities on the details on the case."
Ayub said a pistol and 12 magazine rounds had been recovered from the man's luggage.
However, police officer Dost Mohammad Khan told The Associated Press that 13 bullets were found in the man's luggage ahead of a flight to Islamabad. It was not clear why the bullets were there.
The detention was likely to revive memories of Raymond Davis, an American CIA contractor who shot and killed two Pakistanis in the eastern city of Lahore in January 2011.
A third Pakistani died when he was hit by an embassy vehicle racing to extract Davis from the scene where an angry mob had gathered.
After initial confusion, the U.S. embassy in Islamabad said Davis had diplomatic immunity, which Pakistan refused to recognize. Davis spent almost two months in jail before being released after the payment of compensation to the families of the two men killed.
The incident was a major blow to the relationship between the United States and Pakistan, a key ally in the war on terror.
Ties were just beginning to thaw when U.S. commandos killed al-Qaida leader Osama bin Laden in a Pakistani military town on May 2 in a secret raid which infuriated Islamabad.
The unilateral American raid that killed bin Laden led to a fresh wave of suspicion against Western diplomats by the Pakistani security establishment, which was apparently stung by the realization that the CIA agents were operating in the country without its knowledge.