Khurram was arrested at his home in Srinagar in September, a day after he was barred from travelling to Switzerland.

Authorities in Indian-administered Kashmir released a prominent human rights activist from prison after a court in the disputed region ruled his detention under a controversial security law was illegal.

Police freed Khurram Parvez after the court ordered his release five days earlier. He was arrested and charged in September under the Public Safety Act, which allows detentions for up to two years without trial.

Parvez, chairman of Asian Federation Against Involuntary Disappearances, was arrested at his home in Srinagar a day after he was barred from travelling to Switzerland to participate in a session of the UN Human Rights Council.

Seven Indian soldiers killed in attack on army base

Parvez, 39, and his rights group were the first to publicise thousands of unmarked graves in remote parts of Kashmir, and to demand the Indian government investigate to determine who the dead were – and how they were killed.

His organisation has also written scathing reports about brutality by some of the hundreds of thousands of Indian troops in the region and highlighted the widespread powers granted to them.

The court said Parvez had been imprisoned arbitrarily and authorities had abused their power by ordering his detention.

Parvez said on his Facebook page the 76-day detention was a difficult time for him and his family.

“I won’t let this difficulty make me bitter, instead my resolve for peace and justice has got strengthened,” he said.

The 39-year-old has long campaigned against abuses by state forces in the volatile region of Jammu and Kashmir.

Shortly before his arrest, immigration officials at New Delhi’s international airport had barred him from boarding a plane to Geneva without offering any official explanation, although he had a valid visa and a letter of invitation to participate in the UN session.

Police arrested him after he returned home to Kashmir’s main city of Srinagar, saying it was to prevent him from “causing a breach of peace”.

“It was a very bad experience. And it was a good experience as well … a blessing in disguise,” Parvez told the Thomson Reuters Foundation by phone from Jammu.

“I have learnt so much about the issues faced by prisoners in jails and also about government deficit to address their problems. The jail experience will help me in working for the prisoners whose plight is very bad.”

Relieved 2hear about release of @KhurramParvez,still have 2fight the arbitrary arrest of thousands languishing under inhuman jail conditions — Mirwaiz Umar Farooq (@MirwaizKashmir) November 30, 2016

Welcome back @KhurramParvez, From a smaller prison to the largest open air cage of the world!#Kashmir — Shaista Safi (@Shaista_Safi) November 30, 2016

Parvez’ imprisonment came during the largest protests against Indian rule in Kashmir in recent years, sparked by the July 8 killing of a popular rebel commander by Indian soldiers.

Nearly 90 people, most of them young protesters, have been killed in clashes with security forces in Indian-administered Kashmir since then.

Kashmir has been divided between India and Pakistan since the two gained independence from British rule in 1947. Both claim the Himalayan territory in full.