Nazir Ahmad was arrested in connection with an attempt on Musharraf's life three years ago. He was detained for three months under the Security of Pakistan Act on suspicion of having links with al Qaeda.
Musharraf survived two attempts on his life in December 2003 in Rawalpindi. He narrowly survived the second assassination bid which killed at least 16 people, a majority of them policemen.
A Supreme Court bench, headed by Chief Justice Iftikhar Muhammad Chaudry, disposed of Ahmad's habeas corpus petition after police failed to prove terrorism charges against him.
Police had filed a case of terrorism against Ahmad in Rawalpindi. They said 10 kg of explosive materials; heavy weapons and maps of sensitive areas were seized from him. The Supreme Court in its earlier hearing ordered the Punjab police chief to probe the case of terrorism filed against Ahmad.
The police chief told the Court that district police officer has been directed to take action against those police officials for filing a "baseless" case against Ahmad.
More from rediff