According to counterterrorism department officials, an encounter took place on August 18 in a shanty neighbourhood of Gulshan-e-Iqbal on an intelligence tip that an al-Qaeda cell was active in the city.
Two suspected militants Saleh Muhammad and Fahad were killed in the encounter while a security officer also died in the shootout, one official said.
He said when Saleh's body was buried and later taken out for a post-mortem and DNA tests, it was confirmed his real identity was that of Idrees Baluch.
He said one of Idrees's brothers, Abdullah, was also incarcerated in Guantanamo Bay while his other family members were living in Iran.
Khalid, who hails from the Baluchistan province, was captured by Pakistan's intelligence agencies from Rawalpindi in 2003 and has since then been in US custody.