The two officials of the Pakistani Consulate General in the eastern Jalalabad city had gone missing while travelling from Jalalabad to the border town of Torkham. It was unclear who had been behind the kidnapping. No group had claimed responsibility.
"President Ashraf Ghani personally phoned Pakistan's Charge d'Affiares in Kabul to inform that the Afghan security forces had recovered the two Pakistani officials in a security operation," the foreign ministry said late Wednesday.
Later in the evening, the two officials were handed over to the Embassy of Pakistan in Kabul. They would be flown back to Pakistan to join their families as soon as possible, a ministry's statement said.
Pakistan's Foreign Secretary Tehmina Janjua talked to Afghan Deputy Foreign Minister Hekmat Karzai and conveyed Pakistan's deep gratitude to the Afghan government for safe recovery of the two abducted Pakistani diplomatic officials.
Pakistani sources had earlier stated that the officials were travelling to Pakistan by road, but could not reach Torkham crossing. They were coming to Pakistan for the Muslim festival of Eid.