The detention of a former leader of a banned Islamist terrorist group was declared illegal by a Pakistan court on Tuesday and his release ordered, the court and his lawyer said.
Hafiz Mohammad Saeed, the founder and former leader of Lashkar-e-Taiba terrorist group, was placed under house arrest in the eastern city of Lahore on August 10.
Authorities said he was detained because of fears his activities could disrupt law and order.
The decision to hold him had nothing to do with an investigation into a plot foiled in London this month to blow up airliners over the Atlantic, Pakistan said.
The Lahore high court said on Tuesday the government had failed to produce evidence to justify Saeed's detention, his lawyer, Nazir Ahmed Ghazi said.
"The court found his detention illegal and ordered the authorities to release him immediately," Ghazi said.
A court official confirmed the ruling.
Saeed resigned almost five years ago from Lashkar-e-Taiba, a group active in fighting Indian security forces in India's part of the disputed Himalayan region of Kashmir.
The group has also been accused or suspected of involvement in numerous attacks in Indian cities.
Saeed then become head of a charity called Jamaat-ud-Dawa, which is regarded as a sister organisation of Lashkar-e-Taiba.
The United States has designated both groups as terrorist organisations. Pakistan has banned Lashkar-e-Taiba and put Jamaat-ud-Dawa on a watch list.
Saeed was moved from his house in Lahore last week and his whereabouts were not known, a Jamaat-ud-Dawa spokesman said.