JERUSALEM -- Israel's Supreme Court ruled Wednesday that the state cannot hold Lebanese detainees as bargaining chips to trade for an air force officer missing since 1986.

In response, prison officials announced that 13 prisoners will be released within five days. However, the two most prominent detainees, Sheik Abdel Karim Obeid and Mustafa Dirani, will be kept in custody.The Israeli military said it will not release Dirani, who was the security chief for Amal guerrillas in south Lebanon when he was abducted by Israel in 1994, or Obeid, a Shiite Muslim spiritual leader kidnapped in 1989. Dirani and Obeid are being held in military facilities apart from the other detainees, who are in a civilian prison.

In its ruling, the Supreme Court only ordered the release of eight prisoners whose appeal it heard, but the wording of the decision applied to others.

"The law does not give authority to the defense minister to hold a person in administrative detention if that person does not present a threat to the security of the country," said a court statement summarizing the 6-to-3 ruling. The decision was handed down behind closed doors in the presence of eight detainees.

After the verdict, prison service spokeswoman Orit Messer-Harel said 13 detainees will be freed by Monday.

Some two dozen Lebanese have been held by Israel -- some for more than a decade -- to use as leverage to win the return of Ron Arad, an Israeli airman who was captured alive after being shot down over Lebanon 14 years ago.

Arad's mother, Batia, said she felt betrayed by the high court.

"A man who was sent to defend the homeland was taken prisoner," she said, referring to her son. "Today, they are releasing people who were to have been bargaining chips for the purpose of bringing him home."

"The Supreme Court abandoned Ron today," Batia Arad said.

The chief of staff of the Israeli army, Lt. Gen. Shaul Mofaz, also expressed disappointment. He said "the detention of these people was essential" to the effort to win freedom for Arad.

In Beirut, Lebanon, Mohammed Safa, head of a committee following the fate of the detainees, praised the decision.

"This is a sign that the issue of the detained is taking a new direction," he said.

Human rights groups have criticized Israel for holding the Lebanese without filing charges.

Last month Dirani filed a suit for $1.5 million in damages, claiming he was sexually abused and raped by his interrogators in the month after he was abducted.

Today's ruling was the latest step in a long appeals process. After three Supreme Court justices ruled in 1997 that the state has the right to hold the Lebanese, their lawyer, Zvi Rish, appealed for a larger panel to consider the issue.

The prisoners have been held virtually incommunicado. Except for an Israel TV interview with Obeid in 1991, they have not been seen by the public. Some were allowed to attend court sessions, which have been behind closed doors.

Six Lebanese detainees have been released in recent months.

Five were freed in December in what Israel said was a goodwill gesture at the resumption of Israel-Syria peace talks. Another was freed last week after a lower court ruling was not contested by the state.