An Indian man was arrested in the southern city of Bangalore for being gay after his wife filed a complaint under a federal law that criminalizes homosexuality in the country, local media reports said Wednesday. The arrest was reportedly described as a rare one by senior police officials.

The wife of the computer professional reportedly filmed her husband’s sexual encounters with men while she was away. The wife had installed spy cameras after she suspected her husband's sexual orientation, First Post, a local news website said. The couple reportedly got married in November 2013 and did not live together for the first six months. The wife also reportedly named her husband's parents in the complaint alleging that they knew the truth.

"The wife got suspicious about his behavior because he did not have [a] physical relationship with her. She got more suspicious when she realized that her husband would return home with male friends in her absence," Sandip Patil, a senior police official in Bangalore, told BBC. "The wife fixed CCTV cameras in the house, collected evidence for unnatural sex and filed a complaint with the police. We have arrested him."

In India, gay sex is punishable with life imprisonment under Section 377, a 153-year-old remnant of British colonial law -- of the Indian Penal Code. The law has been reportedly criticized by several activists across the nation. According to local reports, the man has also been booked for cheating under Section 420.

“The (man's) parents have been booked for cheating the victim, but these allegations have to be fully proved before we can arrest them," Patil told Bangalore Mirror, a local newspaper.

Vinay Chandran, executive director of Swabhava, a Bangalore-based nonprofit that works for the lesbian, gay, bisexual and transgender, or LGBT, community, told Bangalore Mirror that the case should be only focused on the part about the 32-year-old man allegedly lying to his wife.

"It's up to the court to find out whether or not the accused is guilty. As far as proof is concerned, the police have appended section 377 to the complaint, but I firmly believe the accused should only be charged with lying and cheating though he was married,” Chandran said.

In July 2009, Section 377 was declared unconstitutional by the Delhi High Court, but the judgment was overturned by the Supreme Court in December 2013.

“In its deliberations, the Supreme Court noted that the dangers of section 377 existed only through blackmail and extortion. It was argued that it could be misused against consenting adults, violating their right to privacy and autonomy, but the court didn’t accept this argument then. This is what has happened here,” Danish Sheikh, a lawyer who works for LGBT rights said, according to Mint, a local newspaper.