SEOUL, South Korea — A former senior South Korean prosecutor was sentenced to two years in prison on Wednesday on charges of banishing a junior prosecutor to an obscure posting after she tried to expose his sexual misconduct.

The case of the former senior prosecutor, Ahn Tae-geun, drew particular attention in South Korea because the accusations of the junior prosecutor, Seo Ji-hyeon, helped fuel a nascent #MeToo movement in this deeply male-dominated society.

Ms. Seo recounted during an interview with a cable channel in January 2018 how she had been sexually molested by Mr. Ahn. Her decision to make public her accusations was an all but unprecedented move in South Korea, where victims of sexual violence have been afraid to speak out for fear of shame and retaliation.

Ms. Seo’s action helped encourage a steady stream of women to come forward with accusations of sexual abuse against an array of prominent men, including theater directors, politicians, professors, Roman Catholic priests and a former national speedskating team coach. Many of the accused men have since apologized for sexual misconduct and resigned from their positions, several of them facing criminal charges.