Five Jewish religious students in the West Bank were killed and 17 others wounded in a gunfire and hand-grenade attack tonight as they were walking from Sabbath prayers at the ancient tomb of the patriarchs in the city of Hebron.

It was the worst Arab attack on Israelis in the 13-year occupation of the West Bank, authorities said.

Hebron, the second-largest Arab city in the West Bank, was immediately sealed off and placed under curfew, and Army units poured into the city searching for suspects.

In Damascus, Syria, a military spokesman for the Palestine Liberation Organization claimed responsibility for the attack, according to Reuter.

[United Press International said two Americans were among those injured in Hebron -- Mordechai Shvat, 21, of New York City and Allon Gasserman, whose hometown was not immediately available.]

[In Washington, a State Department spokesman said, "We are deeply shocked and saddened by what happened in Hebron today. Nothing can justify such a resort to violence. Senseless acts of the sort that reportedly took place in Hebron can only add enormously to the burden carried by those who truly want peace."]

[UPI quoted Israel's deputy defense minister, Mordechai Zippori, as saying Israel would isolate Hebron from the rest of the West Bank.]

["Hebron must be cut off from the rest of the Arab cities of the West Bank and Jordan for a long period," he said.]

Army officials said the religious students from the nearby Kiryat Arba settlement were ambushed while walking from the Machpela Cave shrine, where the patriarchs Abraham, Isaac and Jacob are said to be buried, to the old Hadassah Clinic in the center of the Arab city.

The assailants opened fire with small arms and threw at least two grenades before Israeli troops guarding the Hadassah building rushed out and opened fire themselves.

Since April 1979, the Hadassah building has been occupied by ultranationalist settlers from Kiryat Arba, and their children, in a demonstration designed to pressure the government into allowing Jews to settle in Hebron, an exclusively Arab city since 1929, when 67 Jews were slain in one of the worst Arab riots during the British mandate in Palestine.

Tonight's attack came shortly after the Israeli government told a group of hunger-striking ultranationalist settlers that it will expropriate up to 30,000 acres of West Bank land in the next several months for new settlements and the expansion of existing Jewish civilian outposts.

While there was no known connection between the government pledge and the Hebron attack, the Hadassah Clinic had become a symbol to many Palestinian Arabs of Israel's resolve to settle the West Bank, including densely populated areas that heretofore had been declared off limits to settlers.

The attack on the religious students, who reportedly were on their way to a Sabbath dinner and songfest at the Hadassah building, was the latest in a series of violent incidents in the West Bank in the last three weeks. Yesterday, three Palestinian youths attacked the Tulkarm military governor, and one of the youths was shot to death by an aide to the governor.

The government's promise on settlements today was made as a compromise to end the 45-day sit-in and hunger strike by dozens of settlers who have been camped out in front of Israel's parliament, the Knesset. The settlers immediately ended the demonstration, pending formal Cabinet approval of the agreement on Sunday.

Coming in the midst of intensified negotiations over Palestinian autonomy being held in Tel Aviv, the agreement appeared certain to exacerbate differences between the Egyptian and Israeli delegations, which are seeking to reach an agreement on the autonomy question by May 26.

Under the compromise, a new land expropriation committee will be formed in the government to seize Arab land deemed essential for "public services" and set it aside for settlement use. The seizures will be based on existing Israeli law and Jordanian civil statutes, which are still applicable in the occupied West Bank.

The compromise is designed to satisfy demands by the militant Gush Emunim settlement movement that Prime Minister Menachem Begin's ruling Likud coalition adopt a parliamentary law to tighten the legal status of the West Bank and Gaza Strip settlements and make them virtually immune to court challenges.

Pressure has been building on Begin to bring before the Cabinet a settlements protection law that would put future land expropriation beyond supreme court tests based on the Fourth Geneva Convention prohibitions against the transfer of civilian populations to occupied territories.

Faced with a divided Cabinet and increasing publc opposition to land expropriation for settlements, Begin sent Agriculture Minister Ariel Sharon and Knesset member Haim Druckman, head of the National Religious Party parliamentary faction, to negotiate with the hunger-strikers, Gush Emunim sources said tonight. The sit-in and hunger strike was organized by leaders of the Council of Settlements in Judea and Samaria, the biblical names for the West Bank.

When it became clear to Begin that the proposed settlements protection bill could not pass the Knesset, where the fragile Likud coalition maintains only a five-seat edge, the prime minister proposed a compromise based on existing law, government sources said.

Under the agreement, the Cabinet will decide on Sunday that uncultivated Arab land in the West Bank and Gaza Strip can be expropriated for public purposes by "public bodies" and that settlements will be interpreted as "public services."

Until now, settlements have been justified on the basis of security needs, but Israel's High Court of Justice ruled in the landmark Elon Moreh decision last year that overriding security considerations had not been proved and that the Geneva Convention had been violated. The Elon Moreh outpost, near Nablus, was subsequently dismantled.

Also, Begin reportedly has agreed that if court challenges arise, the government will maintain that the Geneva and Hague conventions do not apply to the West Bank because Jordan's sovereignty over the area after the 1948 war was never established.

Sharon and Druckman could not be reached tonight, but Israeli sources stressed that the proposal still has to be debated in the Sunday Cabinet session.

However, leaders of the hunger strike and Gush Emunim spokesman said they were satisfied the agreement would gain Cabinet approval otherwise they would not have ended the demonstration.

"The promise has been made quite clearly, that existing law will be used to expropriate this land for public use," said Rachael Klein, a spokeswoman for the settlers.

The Gush Emunim said Israel's approximately 70 settlements in the West Bank cover only about 7,500 acres, or only a fraction of the territory's 1.4 million acres. Seizure of the 30,000 acres, the settlers said, would not appreciably affect the Arab population.

However, a Jordanian government report submitted to a United Nations commission investigating settlements said 30,000 acres has already been expropriate or annexed for civilian and military use.