TOKYO — The man who launched a shocking knife attack on the United States’ ambassador to South Korea earlier this year was sentenced to 12 years in prison Friday for attempted murder and violence against a foreign envoy.

The ambassador, Mark Lippert, was left with a long scar across his cheek and restricted movement in one arm after Kim Ki-jong attacked him with a kitchen knife at a breakfast forum in Seoul in March.

“Kim seems to have had a strong will to attack the victim, choosing a knife to repeatedly slash the part of the body that had a direct connection with life,” Judge Kim Dong-ah said in Seoul Central District Court, according to the Yonhap News Agency.

Lippert suffered seven wounds in the attack, with the slash across his right cheek coming within an inch of his carotid artery. He was stabbed in the left forearm as he reflexively tried to defend himself, the 10-inch-long kitchen knife going straight through his arm. He was also slashed along his leg.

He spent five days in the hospital but emerged vowing to continue the friendly and down-to-earth style of diplomacy that has endeared him to Koreans.

Lippert, 42, continues to walk the streets talking to ordinary people, but now has body guards. This week, he posted photos on his Twitter account of him and his wife, Robyn, walking in a central Seoul park with their dog, who has his own following among Koreans.

The 55-year-old man who attacked Lippert was accused of being a North Korean sympathizer.

During the attack, Kim yelled “No war! The two Koreas should be unified” and he later said he was trying to disrupt the joint U.S.-South Korean military exercises that were taking place at the time. The North Korean state media had been putting out statements calling for the exercises to be halted.

Kim was also charged with violating South Korea’s National Security Law, which prohibits citizens from supporting or praising North Korea. However, he was acquitted of that charge.

“While some of the defendant’s arguments coincide with that of the North, such as opposing the military exercises, they are ideas that have been often claimed by the academic circles and civic groups in the country,” the judge said, according to Yonhap.

Pro-North Korean books and documents confiscated from Kim’s house were consistent with his graduate school studies on reunification, he added.

Prosecutors, who had asked for a 15-year sentence, said after the hearing that they would file an appeal over Kim’s acquittal on the National Security Law charge.