SEOUL, South Korea — A South Korean Army sergeant was sentenced to death on Tuesday for killing five of his fellow conscripts and wounding seven others in a shooting rampage in June.

The 23-year-old sergeant, whom a military court identified only by his surname, Yim, attacked soldiers in his unit near the North Korean border with a rifle and a hand grenade, then fled his guard post. After a manhunt, he was captured the next morning, alive but with a self-inflicted gunshot wound near his shoulder.

The sergeant “committed a detailed and premeditated crime of murdering unarmed colleagues in the barracks,” the military court in Wonju, a city east of Seoul, said in its ruling Tuesday.

Sergeant Yim’s lawyers said that they would appeal, arguing that the court had failed to take into account the persistent bullying and ostracizing that the sergeant said he suffered at the hands of his fellow soldiers in the barracks.