SEOUL, South Korea — South Korea’s Supreme Court on Thursday upheld a nine-year prison sentence for a former lawmaker who was convicted of encouraging followers to take up arms to overthrow the government in the event of war with North Korea.

Lee Seok-ki, whose small, leftist United Progressive Party was disbanded by a court last month, was arrested in 2013 on charges including treason. It was the first time such a charge had been brought against a South Korean legislator since the country emerged from military dictatorship decades ago.

Prosecutors said that Mr. Lee had gathered 130 followers in secret to discuss an armed uprising in support of Pyongyang should war break out and that one of his deputies had suggested sabotaging the South’s infrastructure. Mr. Lee’s lawyers accused prosecutors of taking the comments out of context and said the talk of sabotage was meant in jest.

Last February, a court sentenced Mr. Lee to 12 years in prison, but an appeals court in August reduced the sentence to nine years and overturned a conviction on one charge. Six followers of Mr. Lee who had been convicted also saw their sentences reduced.