Journalist Iftikar Gilani won his freedom on Monday after the Chief Metropolitan Magistrate at the Tees Hazari court in Delhi, Sangeeta Dhingra Sehgal, allowed the government to withdraw the charges against him.
He will walk out of the Tihar jail in the evening.
The government had filed an application to withdraw the charges against Gilani, as it had come to realise that there was no evidence against him. On June 9, 2002, the Delhi police had arrested him from his residence in a south Delhi colony.
The income-tax officers, who accompanied the policemen, had confiscated Gilani's computer and several documents, including bank statements, according to his wife. He was booked under the Official Secrets Act for possessing 'classified documents' relating to the deployment of troops in Jammu and Kashmir.
On September 7, he was charged with 'military spying' for Pakistan. The charges brought before Sehgal were based on several sections of the Official Secrets Act and Article 120-B and Article 292 of the Indian Penal Code.
But the case weakened when the Director General of Military Intelligence, O S Lochab, deposed in the court and said that the document recovered from the computer were freely available on the Internet.
"The authorities were not comparing the data recovered from Iftikar's computer with the information published freely worldwide. The moment they did that, it was an open and shut case... It took seven months for the government to realise that," V K Ohri, Gilani's lawyer, said.
Journalists in New Delhi and Kashmir had condemned Gilani's arrest. The Committee for Protection of Journalists and Reporters Sans Frontiers, two international organisations, had written to Deputy Prime Minister Lal Kishenchand Advani urging him to drop the charges.
"Charging a Kashmiri journalist under the Official Secrets Act in the present circumstances will seem an effort to intimidate any media that tries to report independently on the conflict in the province," Reporters Sans Frontiers Secretary-General Robert Ménard had written.
Gilani's arrest had coincided with that of his father-in-law, a hard-line separatist leader, Syed Ali Shah Geelani. His kinship with Geelani was believed to be the reason behind the arrest.
After the order was passed, Gilani told reporters in the courtroom: "These months in jail have been an experience and have taught the value of personal freedom. I am not thinking of suing the government. Freedom is the greatest compensation."
Gilani was the Delhi bureau chief of The Kashmir Times. He was also a regular contributor to German broadcaster Deutshe Welle and the resident editor of Pakistani daily The Friday Times.
"Some news organisations denounced me by relying blindly on the information provided by the government. My arrest is a lesson for all of us [journalists]. It can happen to anyone," he added.