JERUSALEM (AP) _ Israel's Supreme Court on Monday upheld the release of 13 Lebanese prisoners, but Prime Minister Ehud Barak said he was considering legislation that would overrule the court's authority and keep some of the prisoners in custody for several months.

A forum of top security ministers was to convene Tuesday to discuss the legislation, Barak said in a statement.

Apparently reacting to Barak's announcement, the army canceled plans to release the 13 late Tuesday morning. The court ruling gives the army a Wednesday deadline for their release.

The case has pitted the government against the Supreme Court, which in recent months has outlawed tactics Israel has long used in battles against Arab guerrillas and militants.

Last week, the court decided that Israel cannot hold detainees as bargaining chips for Israeli navigator Ron Arad, who was shot down and captured alive in Lebanon in 1986. That decision followed a September ruling barring security services from using force while interrogating Palestinian detainees.

The court said Monday there was no legal basis to hear the Lebanese prisoner case again, rejecting a petition from a group called Terror Victims Association to convene a larger panel of judges to discuss the case. That petition blocked the planned release of 13 detainees Monday morning.

Barak met with legal and parliamentary officials Monday to discuss a bill that would put Lebanese prisoners held by Israel under the authority of the defense minister _ a post Barak also holds.

The court ruling does not apply to the two most prominent prisoners Israel holds, Sheik Abdel Karim Obeid and Mustafa Dirani, who have ties to Lebanese guerrilla groups. They are not among the 13.

In an interview with Israel television, Barak said that he would probably not seek to block the release of the eight detainees who signed the petition to the court. If he went ahead with legislation, he said, it would apply only to Obeid, Dirani and the five other detainees. It would be reasonable to keep them ``for a few months,'' he said.

Barak did not explain the distinction, but it appeared aimed at deflecting criticism _ including from within his own Cabinet _ that his plan for a quick law designed to circumvent a court ruling was fundamentally undemocratic.

Zvi Rish, a lawyer for all 15 of the detainees, planned to petition a Tel Aviv district court Tuesday for the release of Obeid and Dirani.

Such legislation, Rish said, would be a gross injustice to the detainees, some of whom were captured 14 years ago as teen-agers and all of whom are held without trial.

``It's hard to believe that they're going to pass legislation that will actually authorize holding hostages,'' Rish said.

Two prominent ministers with strong human rights records, Police Minister Shlomo Ben-Ami and Justice Minister Yossi Beilin, said they oppose legislation that will allow Israel to retain the 13 prisoners, but that Dirani and Obeid should remain in detention because they are a threat to Israel's security.

Barak is under pressure from Arad's family and relatives of other missing prisoners to find a way to keep the prisoners in custody.

Perchia Heiman, whose brother Yehuda Katz disappeared during Israel's 1982 invasion of Lebanon, said she understood the pain of the Lebanese detainees' families, but that the prisoners were Israel's only bargaining tool in negotiations to return the MIA's.

``We are all victims of politics, us and them,'' she said.

Monday was also Palestinian Prisoners Day, and four Palestinian students were injured in clashes with Israeli soldiers during a protest in Bethlehem. One was moderately injured and three others were lightly injured.