South Korea's highest court has ruled the death penalty does not violate the constitution.
The country has 59 prisoners on death row - but the last executions there were in 1997, before an unofficial moratorium to allow for debate.
Rights group Amnesty International said it was "deeply disappointed" by the ruling, and urged Seoul to fully abolish death sentences.
But analysts say it is unlikely executions will now resume.
The ruling follows a case filed by a 72-year-old man convicted of killing four tourists at sea in 2007, who said the death penalty infringed his constitutional guarantee of dignity.
But the Constitutional Court ruled, by five votes to four, it was "a legal punishment that can deter crime for the sake of the public".
"The death penalty is a kind of punishment that the current constitution expects, and cannot be seen as going beyond the limit of the constitution in terms of (human) rights to life," the ruling said.
Former President Kim had been sentenced to death in 1980
Executing serious criminals helped "protect innocent ordinary citizens and significant public interests", Yonhap news agency quoted the court as saying.
But the judges had said the sentence should only apply in "exceptional cases" and caution was needed to ensure it was not abused, Yonhap reported.
It is the second time the court has ruled in favour of the death penalty, having said in 1996 the social climate was not right to abolish it.
However, South Korea's parliament must rule on whether to abolish or reinstate executions.
A justice ministry spokesman told the AFP news agency: "I don't think there is anyone within the government who can say for sure whether executions will resume or not."
South Korea executed 23 people in a short period in 1997, but no death sentences have been carried out since Kim Dae-Jung became president in February 1998.
Mr Kim had himself been sentenced to death, by the military government in 1980, but his sentence was commuted and he was later pardoned.
Amnesty International said Thursday's ruling was "a major setback" for the country.
Spokeswoman Roseann Rife said it "runs counter to the current abolitionist trend in the country, which has not executed in over a decade".
The group said more than 70% of countries had suspended or abolished capital punishment, and urged South Korea to do likewise.
"Any move backwards on this issue is extremely damaging to South Korea's international reputation," said Ms Rife.
"An economic leader, the country should also lead by example by fully respecting every individual's right to life."