SEOUL, South Korea — South Korean presidential front-runner Moon Jae-in outraged persecuted sexual minority groups by saying during a television debate that he opposes homosexuality, something his supporters say he had to do to win office in the deeply conservative country.

Moon, a liberal candidate and former human rights lawyer, made the comments Tuesday night while responding to a conservative presidential candidate who argued gay soldiers were weakening the country's military.

A protester holding a rainbow flag, approaches South Korea's presidential candidate Moon Jae-in from the Democratic Party, left, at National Assembly in Seoul, South Korea, Wednesday, April 26, 2017. Ahn Jung-won / AP

Gay rights advocates, some of whom who were dragged away after approaching Moon following a speech at the National Assembly in Seoul on Wednesday, see Moon's words as hate speech. Police said 13 activists were detained at the scene of Moon's speech on suspicion of violating laws that ban protests inside the gates of the legislature.

Moon's supporters defended his comments as in line with many South Koreans' views. Moon's camp didn't immediately respond to the criticism by gay rights activists.

Sexual minorities are harshly stigmatized in South Korea and struggle with political visibility because a powerful Christian lobby keeps politicians from passing anti-discrimination laws. Among the five candidates who participated in the debate, only Sim Sang-jung, representing the minor Justice Party, openly advocates gay rights.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

After the conservative candidate, Hong Joon-pyo, argued that gay soldiers were weakening the country's military, Moon said he agreed.

Related: Gay Soldiers Targeted by South Korean Military

Hong then asked Moon whether he opposed homosexuality, to which Moon replied, "I oppose." When Hong double-checked, Moon said, "Of course."

Hong represents the party of ousted President Park Geun-hye, who was arrested last month and now faces the prospect of a prison term over corruption charges.

He recently angered female voters over revelations in a 2005 memoir that he assisted a friend in a failed date rape attempt as a teen. The incident involved mixing the woman's drink with a livestock stimulant, Hong wrote.

A watchdog has recently accused South Korea's military of hunting down and prosecuting gay servicemen. That raised worries of more discrimination and hate crimes against sexual minorities.

Moon later in the debate said that he opposed "discrimination based on homosexuality," but was also against legalizing same-sex marriage.

LGBTQ-rights activists (C) struggle with security members as they protest against South Korean presidential frontrunner Moon Jae-In's anti-gay comment during Moon's election campaign event at the National Assembly in Seoul on April 26, 2017. STR / AFP - Getty Images

"Moon needs to offer an apology and a correction of his comments made on live television," said Jung Yol, a gay rights activist. "What he said was clearly hate speech, and since he is the candidate favored to win the election, his words can influence how people think."

Lawyers for a Democratic Society, a group of South Korean human rights lawyers to which Moon once belonged, issued a statement denouncing the comments by Moon and Hong, saying the candidates revealed their ignorance on human and constitutional rights.

"We cannot look away from the issue as the candidates' comments could encourage hate speech and discrimination against social minorities across the society," the statement said.

South Korea's Constitutional Court formally removed Park from office on March 10. That triggered a 60-day presidential race. Opinion surveys favor Moon to win the May 9 election.

Follow NBC Out on Twitter, Facebook and Instagram