A Pakistani computer expert alleged to have had links with al-Qaeda has been released without charge after three years in custody.
Mr Khan was arrested in the eastern city of Lahore in July 2004
Mohammad Naeem Noor Khan, 25, has been reunited with his family in the city of Karachi, officials and his lawyer said.
Mr Khan was accused of acting as a link between al-Qaeda leaders and militants.
His detention led to the arrest of a suspect in the 1998 US embassy bombings in East Africa, and information on alleged terror plots in the UK and US.
Deputy attorney general Naheeda Mehboob Ilahi announced his release in a Supreme Court hearing, but gave no further details.
Mr Khan's lawyer, Babar Awan, confirmed that his client was back with his family.
He noted that Mr Khan had been held without charge and had never appeared in court.
Security sources told the BBC that Mr Khan had been quietly released several weeks ago and that his home in Karachi was under surveillance.
The Supreme Court has been pressing the government for information about hundreds of people who relatives say were picked up by intelligence agents in recent years.
Mr Khan was arrested in the eastern city of Lahore in July 2004.
Pakistani investigators said Mr Khan had invented secret codes, which enabled al-Qaeda operatives to send encrypted emails and messages via the internet.
Shortly after his arrest, police said a search of his computer files and email records revealed an active global al-Qaeda network, which was planning attacks in Britain, Pakistan and the US.