"The Supreme Court deemed the period of his detention sufficient and decided to release him," the Afghan Foreign Ministry said in the announcement.