A South Korean military court has sentenced an army captain to a suspended prison term for having sex with a fellow male soldier in a ruling human rights groups criticised as regressive and intimidating.

A lawyer for the captain said her client was being punished for having consensual sex with his partner in a private space. She said the captain was briefly treated at a hospital for shock following his conviction.

“It's a ridiculous ruling,” said lawyer Kim In-sook. She said the military penal code, which makes homosexual activity punishable by up to two years in prison, was unconstitutional because it tramples on basic human rights and dignity.

South Korea's military, which doesn't reveal how often it pursues cases against soldiers suspected of being gay, didn't immediately make a statement.

Kim said it's unclear whether her client would appeal his six month prison sentence that was suspended by a year because he felt tormented by the legal process. He will be dishonourably discharged if the ruling stays.

The captain was arrested last month amid allegations by a watchdog that South Korea's military was hunting down and prosecuting gay servicemen. South Korea's army has denied such claims, saying it was conducting a criminal investigation of soldiers who posted a video on the internet of two male soldiers having sex earlier this year.

Lim Tae-hoon, who heads the Military Human Rights Center for Korea, which complained about the crackdown, said in an earlier interview with The Associated Press that neither the captain nor his partner had anything to do with the soldiers involved with the video leak.

According to Lim, military investigators used the information gained from their inquiry into the video case to track down other gay soldiers. Investigators threatened soldiers to out their gay peers, confiscated cellphones to check communication records, and even used dating apps to dupe soldiers into revealing their sexual identity, Lim said.

Lim's group released a statement denouncing Wednesday's ruling, saying that it “turned the clock of history backward.”

“Sexual minorities who are always living in danger of being outed by others now must live in fear that they could be tracked down at any time and interrogated over their private lives,” the group said.

Roseann Rife, East Asia research director at Amnesty International, called for the “unjust conviction” to be immediately overturned.

In conservative South Korea, gays, lesbians, bisexual and transgender people are harshly stigmatised and struggle to be politically visible, while a powerful Christian lobby immobilises politicians seeking to pass anti-discrimination laws. That stigma is amplified in the military, where most able-bodied South Korean men are required to serve about two years as the country maintains a large force in the face of potential conflict with North Korea.

LGBT+ rights around the globe Show all 9 1 /9 LGBT+ rights around the globe LGBT+ rights around the globe Russia Russia’s antipathy towards homosexuality has been well established following the efforts of human rights campaigners. However, while it is legal to be homosexual, LGBT couples are offered no protections from discrimination. They are also actively discriminated against by a 2013 law criminalising LGBT “propaganda” allowing the arrest of numerous Russian LGBT activists. AFP/Getty LGBT+ rights around the globe Brunei Brunei recently introduced a law to make sodomy punishable by stoning to death. It was already illegal and punishable by up to 10 years in prison AFP/Getty LGBT+ rights around the globe Mauritania Men who are found having sex with other men face stoning, while lesbians can be imprisoned, under Sharia law. However, the state has reportedly not executed anyone for this ‘crime’ since 1987 Alamy LGBT+ rights around the globe Sudan Both male and female same-sex sexual activity is illegal under Sudanese law. Men can be executed on their third offence, women on their fourth Getty LGBT+ rights around the globe Saudi Arabia Homosexuality and gender realignment is illegal and punishable by death, imprisonment, whipping and chemical castration Getty LGBT+ rights around the globe Yemen The official position within the country is that there are no gays. LGBT inviduals, if discovered by the government, are likely to face intense pressure. Punishments range from flogging to the death penalty Getty LGBT+ rights around the globe Nigeria Both male and female same-sex sexual activity is illegal and in some northern states punishable with death by stoning. This is not a policy enacted across the entire country, although there is a prevalent anti-LGBT agenda pushed by the government. In 2007 a Pew survey established that 97% of the population felt that homosexuality should not be accepted. It is punishable by 14 years in prison Reuters LGBT+ rights around the globe Somalia Homosexuality was established as a crime in 1888 and under new Somali Penal Code established in 1973 homosexual sex can be punishable by three years in prison. A person can be put to death for being a homosexual Reuters LGBT+ rights around the globe Iraq Although same-sex relationships have been decriminalised, much of the population still suffer from intense discrimination. Additionally, in some of the country over-run by the extremist organisation Isis, LGBT individuals can face death by stoning Getty

Gay men are not exempt from conscription but are banned from engaging in homosexual activity while serving, leading to an environment in which they serve without revealing their sexual identity for fear of discrimination and reprisals.