From an active student leader and member of the Communist Party of India (Marxist) to the status of an accused in an espionage case, it has been a strange journey for Thamim Ansari, who was arrested for allegedly passing information of military value to the ISI of Pakistan.

He was the Thanjavur district secretary of the Students Federation of India (SFI), the CPI (M)’s student wing, a few years ago. He is a native of Adhirampattinam, a predominantly Muslim settlement in Thanjavur district. He is married with one son.

When contacted, a family member declined to comment on the case, saying only their advocate could talk about it. Priya Swaminathan, Ansari’s lawyer, said he had told her that he wanted to make a film that included images of military training and that he had downloaded such footage. He had wanted to show the footage to a producer in Tiruchi and explain how he wanted to make a scene akin to one in Peraanmai, a 2009 Tamil feature film. “I will meet him on Tuesday and apply for bail,” she said.

Ms. Swaminathan said Ansari was active in Rotary club activities. He extended help to many special children. “I am unable to believe that he would have done such a thing,” she said.

Party functionaries are also surprised. “He never gave an impression that he will have such links. I have visited his house. His parents are very pious and have great respect for the party. He has a brother. Ansari was an active member of the SFI and was later elected district secretary. He was also involved in the activities of the Science Forum and was a member of the party unit attached to it,” said CPI(M) state secretariat member M. Srinivasan, also a former party district secretary for Thanjavur.

After leaving SFI, Ansari became successful in the pharmaceutical business and has an office in Thanjavur now under police watch.

“He used to visit the party office once in a while and continued to encourage SFI activities,” said Mr. Srinivasan.

Ansari’s father was abroad and wanted him to join him there. “But I discouraged him from leaving India. He started visiting countries like Singapore, the Maldives and Sri Lanka. But we could never guess that he had such links,” Mr. Srinivasan said.