A former South Korean spy has been jailed for three years after a court ruled Monday that he had intentionally tried to influence the presidential election results in 2012. Won Sei-Hoon, 64, was convicted last September for engaging in illegal political acts while leading the country’s National Intelligence Service (NIS).

The charges against Won are also related to an online campaign that was conducted by the NIS against rival candidates, who were defeated by a small margin by the country’s current president, Park Geun-Hye. A district court had ordered a suspended sentence for Won, stating that though there was clear evidence of wrongdoing there was not enough proof to convict him of trying to directly influence the election result. The latest decision, from the Seoul High Court, overruled the lower court’s judgment and said that the crime was serious enough to warrant a custodial sentence, the Australian Associated Press (AAP), reported.

"It is fair to say Won had the intention to intervene in the election," Judge Kim Sang-Hwan, said, according to Yonhap, the state-run news agency, which added that he was immediately taken into custody.

In September, Won was given a prison term of two-and-half years along with a four-year stay of execution against the prosecutor's wish, who wanted to jail him for four years, Yonhap reported. Won’s subordinates allegedly posted 110,000 messages on online bulletin boards and social media, including tweets, against Park's political rivals.

Won reportedly said, before being taken into custody, that he only did what he thought would work best “for the safety of my country and its people."

The NIS, which reportedly has a long history of being embroiled in scandals, according to AAP, was recently in the midst of another one involving forged documents to build a false spying case against a former Seoul city official who had escaped North Korea in 2004. The current director of NIS, Lee Byung-Kee, has pledged to keep the agency free from domestic politics, AAP reported.