SEOUL, South Korea — The South Korean military on Wednesday decided to discharge a soldier who had undergone gender-reassignment surgery but wanted to remain in military service as a female.

The decision was made amid an outcry from L.G.B.T. advocates in South Korea who said the soldier was being unfairly persecuted and there was no reason she could not fulfill her duties.

The case of the soldier, Byeon Hee-su, a staff sergeant in an army tank unit, highlighted the unwelcome treatment that lesbians, gay men and transgender people often face in South Korea’s socially conservative society, especially in its armed forces. It is the first case in which an active-duty soldier in South Korea has been referred to a military panel to decide whether he or she is fit to serve after having a gender-reassignment operation.

Under the military’s decision, Sergeant Byeon must leave the army by Friday.

Shortly after the decision was announced, she held a news conference, tearfully appealing to the military to reverse its decision. She said that serving in the military had been her childhood dream and that she had been an exemplary soldier.