Israels parliament early today approved by a more than 4-to-1 margin the Camp David summit agreements and dismantlement of Jewish settlements in the Sinai Peninsula, virtually assuring a separate peace treaty with Egypt.

Following 17 hours of continuous debate ending at 4 a.m., the Knesset voted 85-to-19 in favor of the peace proposals, hereby meeting Egyptian President Anwar Sadat's prerequisite that all military bases and civilian outposts be withdrawn from the Sinai as the price for the first peace between the neighboring nations in Israel's 30-year existence.

It was a major political victory for Prime Minister Menachem Begin, who made an impassioned hour-long appeal to the weary Knesset members, warning that if they failed to endorse the pacts, "Israel could not face the world today, nd someday Israel would not have a choice but to accept surrender."

Twenty-eight of Begin's Likud faction, including 11 Herut Party members, voted for the proposals, averting a political crisis for the prime minister.

Earlier, Begin had told a hastily called Cabinet meeting that he would resign unless a majority of the Likud coalition supported the Camp David agreements.

He told his ministers that if the opposition Labor alignment was allowed to put the peace proposal over th top in the roll call, he would hand his resignation to President Yitzak Navon and form a new government.

As it happened, 16 Knesset members abstained - most of them from the coalition - but not enough to give the Labor vote the edge in supporting the measures.

As the marathon debate dragged on, dramatic shifts of political loyalty emerged, with the opposition Labor Party bench rising almost unamimously in support of the right-wing premier and, incongruously, the most conservative members of the coalition angrily denouncing their leader and threatening to vote against him.

The anomaly, although expected for several days, seemed to stun Begin, who after the last speech had been made went to the podium and told the parliament that if they rejected Sadat's insistence that the settlements be removed, they rejected peace.

Peace with Egypt, Begin argued, also means peace with other Arab nations - or at least less likelihood of hostilities.

"If Egypt signs, Syria cannot attack us because Syria knows it would be suicide," Begin said, adding that the same principle applies to Jordan.

"There is no other way out, I believe. This I will believe to my dying day . . . there is no evasion, no escaping from responsibility," he said.

A similar appeal was made by Defense Minister Ezer Weizman, who said, "I believe we are going toward peace. If, God forbid, it is broken, the people of Israel will know why they go back to war, why they go back to the artillery."

As hundreds of demonstrators gathered outside and chanted their opposition to Egyptian President Anwar Sadat's prerequisite that the Sinai settlements be abandoned, Knesset members inside argued hour after hour over whether the agreement would spell the end of all Jewish settlements in the occupied West Bank of the Jordan River and lead to a Palestinian state.

An Israeli military liaison delegation was standing ready to fly to Cairo this morning to begin negotiating practical details for signing a pece treaty with Egypt, which Begin has said could be accomplished before the end of the year.

A team of Israeli technicians also was ready to leave for Cairo today to establish telephone links between Egypt and Israel.

The treaty would end a state of war that has existed between Israel and Egypt throughout Israel's 30-year existence, opening borders for commerce and tourism, opening the Gulf of Suez to Israeli shipping, and resulting in an exchange of embassies and normalization of relations between the two countries.

During the debate, some of Begin's staunchest supporters during his 28 years in the opposition and after his election lst year bitterly attacked the prime minister. Some of this most dovish opponents showered him with warm praise, althoug tempered for practical political reasons with broad criticism of his handling of Israel's foreign policy in general.

"I do not trust you. I do not trust your path," shouted Moshe Shamir, a leader of Begin's Herut Party and a long-time ally of the prime minister, as he angrily shook his finger at Begin.

"What you are saying is that there is no justification for Zionist enterprises in Israel . . . Why was it necessary to give in to this pressure?" Shamir asked as Begin sitting in the front row, turned to one side as if not listening.

"I do not trust you. I do not believe the principles of giving such a heavy blow to villagers who settled on Jewish land. It is people, people ready to undertake sacrifices, people who withstood the tests of the past," Shamir said.

"This blow which has been brought down on Sinai on the very roots of Jews . . . It is not peace. It will bring terror, and in its wake will come unrest in the streets.

"Dear friends, we are endangering our very existence. We are endangering the wish of young people in this country to live among us. Let us find a new formula. Let us not agree to swallow this poisoning drink," Shamir implored, as Knesset members alternately heckled and encouraged him.

Moshe Arens, also of the Herut Party and chairman of the Knesset Foreign Affairs and Defense Committee, also attacked the agreement, saying it would lead Israel to grave danger from Arab enemies.

Likening the settlements to a defensive wall, Arens said, "Once we remove its layer of stone, the wall will never be strong again."

Yoram Aridor, another Herut member and long-time Begin ally, said that while the "battle of the Sinai is over," the agreement would lead to a Palestinian state on the West Bank.

"May my traitorous right hand wither if I forget the West Bank of the Jordan River," he said.

Many of the members favoring the Camp David pacts were equally emotional in their support of what Begin presented as the "price of peace."

Haika Grossman, a former guerrilla figher and member of the left-wing Mapam faction, declared. "The time has come for us to take the responsibility to stop the killing, to take this country out of a wave of war."

Grossman unleashed a scathing attack on the ultranationalist Gush Emunim, or Faith Bloc, which has been demonstrating in support of the settlements. She called the Gush members "imaginary pioneers" and told Begin, "They are robots you have created."

For years, Begin has been the Gush Emunim's most vocal advocate, frequently urging the group to build more settlements on the West Bank to asure Israel's "eternal" right to the territory captured from Jordan in the 1967 Middle East War.

"Why love them?" Grossman asked Begin, a reference in which he said no matter how much the Gush Emunim attacked him, he would "return love."

Grossman's speech triggered an outburst of heckling from the floor, particularly among Herut members and some National Religious Party representatives.

Binyamin Halevy, a Democratic Movement Knesset member and former justice of Israel's Supreme Court, also referred to the Gush Emunim, but said, "They are not an obstacle to peace. They are a crucifixion to peace." While calling the settlement withdrawal a "Zionist defeat," Halevy said, "I am convinced beyond doubt that this cruel sacrifice is absolutely necessary."

The Labor Party's Abba Eban, a former U.N. ambassador, praised the Camp David pacts, praised Begin and praised Defense Minister Ezer Weizman, adding, "There is no doubt in my mind that the achievement is greater than the price."

As Communist members shouted protests, Eban said the agreements have brought "the most fundamental change [of] breaking the circle of war." He said they would not only lead to peace with Egypt but would create better relations with the United States and European countries and create "the opening of the presence of Israel in the Third World . . . It will transform our image as a barrier to peace in the Middle East."

Referring to the Likud and the Labor alignment. Eban added, "I recommend much less pride in one camp and less inferiority complex in the other camp . . . There is no negotiation without compromise.

"This is the time; let us not miss it," Eban implored.

Zeidan Atche, a Druze member of the split Democratic Movement for Change, appealed to Arab leaders of the West Bank "not to listen to those who propose violence, but to listen to those who protect peace." Speaking alternately in Hebrew and Arabic, Atche said, "To miss a rare opportunity for peace would be a grave mistake."

On the West Bank, some Arab majors listened to the televised debate in their offices with translators at their sides. Several said they were particularly interested in how the Knesset debate would described the link between the Egypt-Israel pact and the future of the West Bank.

During the debate, the argument often spilled out into the Knesset corridors and the members' dining room, where fierce discussions were held while lesser-known members inside spoke to a near empty chamber.

Josef Rom, a Herut member, said the agreements contain "certain elements" found in the Munich agreement of 1938, citing what he termed Sadat's ultimatum on the settlement issue.

Begin bumped into Rom in the corridor and chastized him for making such statements, saying that as a relative newcomer to Herut Rom had no right to express such opinions.