For more than 200 days, a young, jailed Indian doctor faced charges under a national security law that allows the authorities to detain people if they feel they are a threat to national security.
The allegations against 38-year-old paediatrician Dr Kafeel Khan arose from his speech at a student meeting last December criticising a controversial new citizenship law that is seen as discriminating against Muslims and which has roiled India.
At the meeting in Aligarh in Uttar Pradesh state, Dr Khan had accused the ruling BJP government of indulging in sectarian politics and ignoring the "real issues". He had also spoken about the declining health of children, rising joblessness and the teetering economy. "We won't be afraid, no matter how much you scare us. Every time we rise, no matter how much you suppress us," he told some 600 cheering students.
The police in Uttar Pradesh, now ruled by a controversial Hindu religious leader known for his anti-Muslim rhetoric, found Dr Khan's speech incendiary. Some 45 days after he made the speech, Dr Khan was arrested and sent to prison.
"He tried to incite the religious sentiments of the Muslim students present in the meeting and to increase the hatred, enmity and disharmony towards the [Hindu] community," police told the court.
On Tuesday, the high court in Allahabad disagreed with the police and threw out the case, saying Dr Khan "did not promote hatred or violence". Two judges said the doctor actually gave a call for "unity among citizens", and that authorities had read the speech selectively.
"First he was a scapegoat. Now he has become an enemy of the state," his brother, Adeel Khan, a businessman, told me.
Dr Khan has spent most of the past three years shuttling between prisons. He was jailed for seven months, awaiting trial on charges of culpable homicide and negligence after more than 70 children died in August 2017 in a public hospital in Gorakhpur, 800km (507 miles) east of Delhi, where he worked as a junior doctor. Eight other hospital workers, including the principal of the hospital, were also imprisoned on similar charges.
Most of the deaths were the result of the hospital's oxygen supply being cut, allegedly because bills amounting to $100,000 (£75,000) had been unpaid, something that the government continues to deny.
Dr Khan was granted bail in April last year. In September 2019, an official probe cleared him of any negligence, but there was no apology from the government.
Dr Khan's supporters say he was targeted because he shone a light on government negligence. His life as a low-profile doctor at Gorakhpur's busy 1,000-bed Baba Raghav Das Hospital had changed irrevocably that night.
Sick children died after oxygen supplies - the liquid oxygen tank and bank of 50-odd back up cylinders - ran out. Over the next 54 hours, Dr Khan says he frantically organised dozens of cylinders.
He withdrew his money from an ATM and ran to hospitals and shops, and even a paramilitary force barracks to pick up whatever supplies they could spare. A dozen paramilitary soldiers helped him. Nearly two nights later, piped oxygen flow was restored at the hospital.
A video showed Dr Khan begging nearby hospitals for oxygen canisters after learning that his hospital's central supply had been exhausted.
"I brought 250 cylinders in 24 hours! 250! I don't know how many children lived or died but I did my level best," he said.
Many in Gorakhpur say other doctors also helped secure oxygen for the hospital that night, but Dr Khan received more attention because he took the lead and because of the video, which went viral.
Uttar Pradesh Chief Minister Yogi Adityanath visited the hospital a few days later. Dr Khan says his interaction with the leader turned his life "upside down".
According to Dr Khan, Mr Adityanath asked him whether he had arranged for the cylinders. When Dr Khan answered in the affirmative, he said Mr Adityanath "got angry" and snapped, saying: "So you think by arranging cylinders you became a hero?"
Mr Adityanath has not commented on this. When Dr Khan's family later met him a few times to press for his release, they said he told them: "Justice will be done".
"The chief minister was angry because this incident came into the media," Dr Khan wrote in one of his letters from the prison.
A year later, when he was out on bail, Dr Khan was re-arrested and put behind bars for 45 days for allegedly barging into a government hospital in the district of Bahraich, where he says he had gone to find out more about the deaths of children who had died of encephalitis. Dr Khan is a "man under constant probe", one newspaper wrote.
Dr Khan says he has travelled across India in the past year, setting up more than 100 medical camps in areas hit by monsoon floods and has treated children suffering from encephalitis, a deadly inflammation of the brain that has been rampant in many regions.
His associates say he has completely transformed from a shy and bookish paediatrician who loved cricket and photography to an outgoing, strident community doctor and campaigner.
When Delhi-based doctor Harjit Singh Bhatti met Dr Khan last year at a function, he asked him how he had changed so much. "He told me that the experience in jail had changed him. He said he had lost his fear. He said, now I will speak for my people and my patients," Dr Bhatti told me.
Jailed at a time fellow prisoners were infected with coronavirus, Dr Khan wrote letters. Two of his five letters were addressed to Prime Minister Narendra Modi. "I am a doctor. We need more doctors to fight the scourge of Covid-19. Please let me free. I feel I could be of some help in curtailing the disease," he wrote to Mr Modi.
Dr Khan has become somewhat of a polarising figure. His supporters say he's a living symbol of "state and religious oppression" under Mr Modi's rule. His critics says he has shared a public platform with leaders of opposition parties ranged against the ruling BJP, and has political ambitions.
"He's a fighter to the finish, and a very ambitious man now," said one former associate.
Of the eight hospital workers, including four doctors, who were suspended after the hospital tragedy, only Dr Khan has not been reinstated and receives only half of his salary from the government. "Our family has been harassed and targeted and we have gone and met ministers and held press conferences," says Adeel Khan.
Dr Khan is one of six siblings, including two sisters. His deceased father worked as a government engineer and his mother, a graduate, is a homemaker. One brother is a doctor, one is an engineer and another, a businessman. The sisters hold degrees in chemistry, and one of them teaches in Oman.
Dr Khan is now in a government guest house in Jaipur in Rajasthan state, where his wife, a dentist, and two children, a four-year-old daughter and an 18-month-old son, will join him. Early on Wednesday morning, the family hopped into a car and began the 840km (521 mile) journey from Gorakhpur.
"I plan to go to some flood-affected areas in India and set up medical camps to treat people and prevent epidemics," Dr Khan told reporters on the night of his release. The feisty activist doctor is back.