Israel's parliament voted Tuesday night to close all 21 Jewish settlements in the Gaza Strip, evacuate their 8,100 residents and withdraw thousands of Israeli troops that protect them, handing Prime Minister Ariel Sharon a major political victory on an issue that has created a deep rupture in Israeli politics and society.

Sharon's Gaza disengagement plan was approved by a 67 to 45 vote in the 120-member parliament, or Knesset, even though almost half the members of his Likud Party and most of his traditional allies in ultranationalist and religious parties abandoned him. Sharon was supported instead by longtime opponents in more dovish parties who historically have viewed him as their archenemy. Seven lawmakers abstained, and one was absent.

Immediately after the vote, however, four cabinet ministers from Likud, including Finance Minister Binyamin Netanyahu, announced that they would resign from the government within two weeks if Sharon did not agree to subject his plan to a nationwide referendum. In addition, Sharon fired one Likud cabinet minister, Uzi Landau, and a deputy minister for voting against the proposal.

The vote moved Israel a step closer to what would be its first withdrawal from Jewish settlements since 1982, when settlers were pulled out of the Sinai Peninsula under the Camp David peace accords with Egypt. Israel has never vacated a settlement in the Gaza Strip or the West Bank, which many religious Jews say would be an abandonment of the Jewish homeland. Thousands of settlers protested outside the Knesset building Tuesday, many branding Sharon a traitor.

Yet many Israelis described Tuesday's vote as a milestone, with Sharon forcing the country to reconcile its need for peace and security with its 37-year occupation of the West Bank and Gaza.

"This is the most dramatic, head-on confrontation in years between ideology and reality, between the messianic ideology of the Israeli right and the pragmatic considerations of the state of Israel in its relations with the Palestinians," said Yaron Ezrahi, a political science professor at Hebrew University of Jerusalem.

The vote, which was widely predicted, followed 17 hours of acrimonious debate on the floor of the Knesset punctuated by name-calling and heckling. Three members were evicted during Sharon's opening speech Monday for refusing to remain silent.

Sharon's plan, which was crafted without Palestinian input, must still clear several legislative hurdles. But if it is implemented, settlers would begin leaving all 21 Gaza settlements and four small settlements in the northern West Bank early next summer. Homes and synagogues would be destroyed; infrastructure would be turned over to a third party rather than handed directly to the Palestinian Authority. Compensation packages ranging from about $100,000 to $500,000 have been approved for uprooted families.

Israeli troops would pull out from most of Gaza by the end of 2005, but the Israeli military would retain control of Gaza's borders, coastline and airspace.

Ultra-Orthodox rabbis have called on soldiers to disobey orders to evacuate settlements while political leaders have warned that such evacuations could take Israel to the brink of civil war. Israeli security officials say Sharon has been the target of death threats.

Senior politicians and leading political analysts say Tuesday's vote could split Likud -- the Knesset's largest party with 40 seats -- and cause the government to collapse or force Sharon to call early elections.

Many lawmakers on opposing sides of the issue favor subjecting the plan to a binding, nationwide referendum, and negotiations continued Tuesday night to persuade Sharon to accept the idea. Even though public opinion polls show that about two-thirds of Israelis support withdrawal from Gaza, Sharon has said he opposes a referendum, describing it as a legalistic stall tactic intended to kill the measure. But Likud activists and political analysts say he may have to accept such a vote to prevent his minority government from collapsing.

That seemed to be the threat implicit in Netanyahu's warning that he, Education Minister Limor Livnat, Agriculture Minister Yisrael Katz and Health Minister Danny Naveh -- all of whom voted Tuesday night in favor of the Gaza withdrawal -- would quit the cabinet in two weeks if Sharon did not agree to a referendum. Likud members voted against the plan this year in a party-wide referendum, and the Likud Central Committee rejected it at a party convention in August.

"We are giving them a two-week chance, and if not, we can't remain in the government," Netanyahu, a former prime minister, told reporters outside the Knesset chamber.

Efraim Inbar, a political scientist at Bar-Ilan University in Ramat Gan, near Tel Aviv, said that if Sharon refused and the cabinet members resigned, "he may become a minority in his own party, and this will bring down his government."

While Israelis saw Tuesday's vote as historic, many Palestinians and some Israeli Arabs criticized the disengagement plan, noting that Israel would continue to control all access to the Gaza Strip after the withdrawal. Several pointed to an interview two weeks ago in which Sharon's top adviser and former chief of staff, Dov Weisglass, said that the true aim of the plan was to indefinitely freeze the political process with the Palestinians while allowing Israel to strengthen its grip on the West Bank, where about 240,000 Jewish settlers live in 120 settlements, surrounded by about 2.2 million Palestinians.

"I cannot accept the evacuation of Gaza from the inside and the incarceration of Gaza from the outside while Weisglass talks about deepening the occupation of the West Bank and annexing settlements there to the state of Israel," said Ahmed Tibi, an Israeli Arab member of the Knesset who voted against the plan.

"We welcome any Israeli withdrawal from any Palestinian land," said Hassan Abu Libdeh, chief of staff to the Palestinian prime minister, Ahmed Qureia. But to be successful, he said, it has to be part of "a resumption in the peace process and implementation of President Bush's vision of a Palestinian state alongside an Israeli state."

Instead, Abu Libdeh said, Sharon is "marketing the Gaza redeployment as a major Israeli step, when in fact it is a major initiative to take over for good much of the West Bank."

About 17,000 demonstrators, mostly from Jewish settlements in the West Bank and Gaza, held a festive, day-long protest outside the Knesset. Many said they felt betrayed by Sharon, who is widely considered the architect of Israeli settlement expansion.

"Sharon is a traitor," said Anat Livni, 45, of Nofim, a small West Bank settlement 25 miles north of Jerusalem that is not targeted for evacuation. "We built our lives in these places, and we raised our families there. How dare Sharon tear us away from our homes and give them to the enemy?"

Some complained that by withdrawing unilaterally, Sharon was rewarding Palestinian terrorism and getting nothing in return, unlike the 1982 Sinai withdrawal, part of an agreement in which Israel won a formal peace with Egypt.

"Giving away territory only encourages the terrorists and shows them that murdering us pays off and brings them the results they want," said Adi Rodal, 31, who lives in the northern West Bank settlement of Peduel, which is not to be evacuated.

Settlements closed schools and gave children the day off so they could attend makeshift civics classes in the parks that surround the parliament building.

"My brother and I built a model of our house in Gush Katif that the bad men in government want to destroy," said Avital Kadishman, 8, referring to settlements in the southern Gaza Strip. "They want to smash up our house and throw us out, not just our family but all our neighbors as well. The government doesn't like us anymore and are throwing us away."

Researcher Samuel Sockol and special correspondent Ian Deitch contributed to this report.

Prime Minister Ariel Sharon receives congratulations after vote to remove settlers and troops in the Gaza Strip. Orthodox Jews who oppose the pullout plan protest outside the Israeli parliament in Jerusalem.