A 22-year-old Assam resident has been released from the Silchar prison, where he was detained for being an undocumented Bangladeshi immigrant for over six years, reported the Hindustan Times on Thursday. He was released on the orders of the Gauhati High Court.

In 2015, the man had run away from his Guwahati home when he was 15 years old and suffering from mental illness, according to the Hindustan Times. “Leave us and go to Bangladesh,” his father had told him during an argument.

Upset about the quarrel with his father, the teenager left his home and boarded a train at the Guwahati Railway station. But he had been stopped during a routine check by a railway police officer, who sought to know where he was going.

After he told the officer that he was going to Bangladesh, he had been detained and asked to produce documents to establish his Indian citizenship.

On January 21, 2016, a Karimganj court declared that the teenager was a foreigner as he had failed to produce his documents and also could not give any information about his family, according to the Hindustan Times.

The authorities then tried to deport him to Bangladesh. However, Dhaka blocked the deportation after the government could not confirm his citizenship.

The man’s father came to know that his son was detained before authorities tried to deport him.

“After more than a year, I received the call from Silchar Central Jail from somebody who said that my son has been declared a Bangladeshi and he will be deported soon,” the father told the Hindustan Times. “My one remark [telling his son to go to Bangladesh] destroyed his life and he ended up in jail.”

The parents told the newspaper that they tried to move the Gauhati High Court for their son’s release but the lawyer’s sought Rs 1 lakh for every hearing.

Lawyer P Agarwal, however, agreed to represent the man without charging the family any money, reported The Sentinel. The man was released after Agarwal moved a petition against his continued detention.

On May 5, the High Court will pass a verdict on the 22-year-old’s citizenship.

“Our son is free because of our lawyer,” the father said.

In the last hearing, a special bench of Justices Kotiswar Singh and Nani Tagia had asked the District Legal Service Authority of Cachar and Kamrup districts to verify whether the man was the son of the petitioner. Both the bodies told the High Court that that there was adequate documentary evidence to establish that the petitioner was the detainee’s mother.

“Nobody can understand what a mother goes through when her son, who is not typical, is declared a foreigner,” she said. “I wish no mother in the world goes through what I have faced.”