SEOUL, South Korea — A close political ally of President Moon Jae-in of South Korea was sentenced to two years in prison on Wednesday for conspiring with bloggers to illegally influence public opinion before Mr. Moon’s election in 2017.
The politician, Gov. Kim Kyoung-soo of South Gyeongsang Province in the country’s southeast, was taken to prison shortly after Seoul Central District Court convicted and sentenced him on Wednesday.
No evidence has emerged that Mr. Moon was aware of Mr. Kim’s activities. But the verdict is a political setback for the president, for whom Mr. Kim was a key adviser during the 2017 presidential campaign, in which Mr. Moon ran as a champion of clean politics.
Mr. Kim was accused of working with a blogger named Kim Dong-won, known widely by his alias, Druking, to sway online opinion in favor of Mr. Moon, both before and after the election.
In an indictment last year, prosecutors said a team led by the blogger had used special software to post 1.4 million comments, aimed at promoting Mr. Moon and his policies, on articles on domestic news sites between December 2016 and March 2018. The bloggers also generated 99.7 million “likes” and “dislikes” for the articles, according to prosecutors.
By doing so, prosecutors said, those involved in the scheme violated laws that prohibit secret online influence campaigns before an election.
Judge Sung Chang-ho said there was enough evidence to prove that Mr. Kim, the governor, had collaborated with Kim Dong-won. He personally visited the blogger’s office in late 2016 and endorsed his operation after watching him demonstrate the software, and he promised to help one of the blogger’s associates get a job in Mr. Moon’s government, the judge said.
“The crime of the accused lies not just in obstructing the business of internet portal sites, but also in attempting to distort public opinion by seriously damaging the function of online space to formulate them in a transparent manner,” Judge Sung said.
Prosecutors said the alliance fell apart early last year, after the governor failed to deliver the promised government job. The blogger then turned his operation against the Moon administration, prosecutors said. Mr. Moon’s party sued the blogger, accusing him of introducing an illegal smear campaign — but the subsequent investigation revealed his earlier activities on Mr. Moon’s behalf.
Mr. Kim, the governor, who has denied the charges against him, said after his sentencing that he would appeal. “I will fight to the end,” he told reporters.
Mr. Moon’s office said the verdict was “completely unexpected.”
Kim Dong-wan, the blogger, who was tried separately, was also convicted on Wednesday. He was sentenced to three and a half years in prison.
The case has ironic echoes of the 2017 conviction of Won Sei-hoon, former director of South Korea’s main spy agency, the National Intelligence Service. He was sentenced to four years in prison for running a clandestine online operation to promote Park Geun-hye’s presidential campaign in 2012, which Ms. Park won.
A court found that Mr. Won had directed a secret team at the spy agency to work with private bloggers to smear Ms. Park’s political rivals, including Mr. Moon.
Mr. Moon vehemently denounced the spy agency’s meddling in domestic politics. He won the snap presidential election called in 2017 after Ms. Park was impeached and removed from office, and after becoming president he sharply curtailed the spy agency’s ability to operate domestically in areas not related to counterintelligence.
Mr. Kim’s conviction comes at a time when Mr. Moon is struggling to shore up his popularity. His approval ratings, which surpassed 80 percent last year as he engaged in diplomacy with North Korea, have recently fallen below 50 percent, with the economy sputtering and talks between the North and the United States having shown little progress.
The sentencing of Mr. Moon’s adviser is likely to provide new ammunition for critics of the president, most of them older South Korean conservatives skeptical of his North Korea diplomacy. Recent anti-government rallies in downtown Seoul organized by conservatives have been growing in size.