Israeli military authorities dismissed the acting Arab mayor and elected council of this strife-torn city in the occupied West Bank today following the stabbing death yesterday of a Jewish seminary student by unidentified Arabs.

The dismissal, which left only one of the eight major cities on the West Bank with an elected leadership, came as tensions increased here and in Jerusalem, where violent demonstrations at the Al Aqsa Mosque in the Old City today resulted in the arrest of 40 Arabs and injuries to eight policemen and six Arabs.

The Palestine Press Service, an Arab agency based in East Jerusalem, said the Al Aqsa demonstration was to show support for Yasser Arafat, involved in a leadership struggle in the Palestine Liberation Organization, but previous pro-Arafat demonstrations there had resulted in no violence.

The slaying last night of Aharon Gross, 19, followed a spate of violent incidents here during the past three weeks involving Jewish vigilantes from Kiryat Arba, a settlement on the outskirts of Hebron, and the local Arab population in the dispute over the expanding presence of Jews in the city's center.

Settlers from Kiryat Arba retaliated for the slaying last night by setting fire to the Arab market in the city's center.

Earlier, enraged settlers had mobbed Defense Minister Moshe Arens, who came here shortly after the killing. They shouted, "Killer, killer!" and demanded better military protection for Israelis who have moved into the old Jewish quarter of this city.

Despite the curfew imposed by the Army on the downtown area, the settlers were able to go into the central market and set it ablaze and smash windows of Arab shops and cars. Because of curfew restrictions today, it was impossible to determine the extent of damage.

Gross reportedly was carrying an Uzi submachine gun, which his assailants tried to seize before jumping into a car to get away. His colleagues reportedly opened fire on the car but could not stop it.

Seminary students, like most of the Jewish men who live in or enter downtown Hebron, regularly carry Uzis for protection.

Gross was the eighth Jew killed here in three years. Six were shot to death in an ambush as they walked on a street in May 1980. Another died as the result of a stoning earlier this year.

Reports of the circumstances in which Gross died remained confused. But various local sources and later a senior Army officer in Tel Aviv said he apparently bled to death after being set upon and repeatedly stabbed by several Arabs while he was waiting outside the central market for a bus to take him back to Kiryat Arba.

These sources said he was left unattended, lying in a pool of blood on the street, for 90 minutes because three colleagues had gone off "to chase the Arabs" without telling authorities of the incident and no one had come to his aid.

Arabs who saw him lying in the street reportedly did not want to get involved for fear of being accused of attacking a Jew, while Israelis assumed that he was an Arab and did not move to help him.

"You can see this is not a city of love," remarked the senior Army officer, who said military authorities were not informed of the attack on Gross for more than two hours.

The dismissal of Hebron's acting mayor, Mustapha Natche, leaves only Bethlehem among the West Bank's eight major towns and cities with an elected council and mayor. Since the last elections in 1976, Israel has dissolved the councils of about half of the 26 towns here and placed a military officer or an appointed Arab in charge of civil administration.

In removing Natche and dissolving Hebron's council, the military authorities accused them of contributing to "the atmosphere of tension, hostility and encouragement of extreme elements" in the city, boycotting the Israeli military's civil administration and refusing to provide basic services to the new Jewish homes in the downtown area.

Natche was also accused of violating Israeli occupation regulations by accepting "enemy funds" from outside the country.

In an interview at his home today, Natche insisted that he and the council were not responsible for security matters in the city and thus could not be held accountable for the slaying of Gross or for other recent violence.

These have included stone-throwing by Arab youths at Jewish cars, bombs and grenades set off by Arab and Israeli extremists, the destruction of municipal utility poles on land claimed by Kiryat Arba and the burning of two Arab buses by Jewish vigilantes.

Natche said he informed the military authorities five years ago that the municipality had received $10 million from Saudi Arabia and had since given them a month-by-month accounting of city financing. Most municipalities on the West Bank have received revenue from Arab states and Israel has customarily allowed such funding.

Natche, however, did not deny the boycott or refusal to provide services to Jewish homes inside Hebron and warned that tensions were bound to mount if more settlers tried to move into the old Jewish quarters.

Natche said the Jewish settlers had been pressing the military authorities to dismiss him for a long time "because they don't want anybody in the city to say, 'Stop, this is illegal.' " He was referring to the takeover by the settlers of Arab homes and property.

In the past few years, settlers have been moving back into the old Jewish quarter of this city from where the Jews were driven in 1929 after a massacre by Arabs. The quarter now takes up much of what is downtown Hebron, bringing the settlers into the heart of the otherwise Arab city.

Today, Arens told a foreign press lunch in Tel Aviv that he believed it "proper and just" for the entire Jewish quarter to be reoccupied and rebuilt by Israelis just as had been done in Jerusalem's Old City. He promised to do everything in his power to see that it is done.

He also said he had "no choice" but to confirm the decision of the local military commander to fire Natche because he had played a "considerable part" in creating the atmosphere that led up to the attacks on Jews and the killing of Gross. But he said he was determined to see law and order enforced "without discrimination" and would not tolerate Jewish vigilantes or Arab extremist activity.