Israel's High Court of Justice today blocked the deportation of Nablus Mayor Bassam Shaka to give him time to exhaust his appeals to a military tribunal.

Shaka was imprisoned last week and ordered deported on the basis of a disputed allegation that he expressed sympthay for therorists during a private conversation with a military official. He was given three days to appeal the decision to a special military committee considsting of a judge and two Army officers.

If the committee upholds the deportation order, Shaka will be given two or three more days to prepare a final appeal to the same three High Court judges who issued today's decision.

Shaka's lawyer, Felicia Langer, who previously refused to appeal to the military committee because it represents the same defense branch that originally ordered the Nablus mayor deported, said after today's hearing that she will submit the appeal Friday or Sunday.

"Then, if the committee decides in the negative, we will appeal to the High Court," Langer said. "I believe that the cause is just and the case is good."

Shaka, major of the West Bank's most militantly nationalistic city, became a rallying point for Palestinians in the occupied territories when the government ordered him deported for allegedly saying he sympathized with the motives of Palestine Liberation Organization terrorists who conducted the March 1978 massacre of 34 persons on the coastal road near Tel Aviv.

Following press reports of a distorted version of the statements, made by Shaka in a closed-door talk with Army Maj. Gen. Danny Matt, coordinator of the occupied areas, Defense Minister Ezer Weizman and a Cabinet defense committee ordered Shaka expelled to an Arab country.

When the official transcript of the conversatin showed that Matrt four times attempted to draw Shaka into an endorsement of the terrorist attack and that Shaka repeatedly said that, given 13 years of occupation, such attacks were to be expected, the government broadened its case against Shaka to include membership in the PLO and alleged attempts to incite rebellion.

The case quickly becase a cause celebre in the occupied territories with mayors of all 25 municipalities resigning in protest and several cities staging general strikes and demonstratins. For the first time in years, the issue united the West Bank with th Gaza Strip against the Israeli government. Israel tacitly had encouraged divisions between the two areas by suggesting its autonomy plan could be implemented first in Gaza if the West Bank continued to boycott the Camp David peace process.

In the U.N. General Assembly, 132 nations voted for a resolution against the expulsion, and soon afterward U.S. Secretary of State Cyrus Vance wrote to Prime Minister Menachem Bgin asking Israel to reconsider the deportation order.

When Shaka, who has been conducting a hunger strike in prison for six days while awaiting the court hearing, walked into the packed chamber, about 100 Arab and Jewish supporters applauded. Shaka held his hands above his head in a victory sign and smiled broadly.

About eight Palestinian mayors attended, but conspicuously missing was Gaza Mayor Rashid Shawa, who has been ordered by military authorities not to leave the Gaza Strip.

Shaka, showing no ill effects from his hunger strike, sat in the defendant's dock fingering worry beads and smiling, as the arguments were presented in Hebrew. Occassionally, an interpreter whispered to him.

While the prosecution limited its brief mostly to an argument that Shaka had not exhausted all his legal remedies in the military committee, Langer invoked the Geneva Convention and the Nuremberg trials.

The Geneva Convention, to which Israel is a signatory, prohibits individual and mass transfers or deportations from an occupied territory and requires that persons convicted of offenses serve their sentences in the occupied country. A ruling in the Nuremberg trials of 1946 declared it a war crime to deport persons from an occupied territory, Langer said.

Israel has maintained that international conventions on occupied areas do not necessarily apply to the West Bank, because Jordan, which annexed the area after the 1948 war, was recognized by only two nations -- Britain and Pakistan -- as having legimate sovereignty over the West Bank.

Coincidentally, Begin today asked his Attorney General, Yitzhak Zamir, if he would issue an opinion on the legality of transferring civilians to Israeli settlements in the West Banks. Presumably, opinion would be based on the contention the West Bank is not an occupied area.

About 200 Arabs and Jews supporting Shaka demonstrated outside the court today and there were some brief scuffles between demonstrators and Israelis walking through the compound.