Prime Minister Benjamin Netanyahu’s government on Tuesday for the first time advanced a plan to overhaul the country’s legal system, defying a mass uproar among Israelis and calls for restraint from the United States.

The vote marked only preliminary approval for the plan. But it raised the stakes in a political battle that drew tens of thousands of protesters into the streets, sparked criticism from influential sectors of society and widened the rifts in an already polarized country.

The 63-47 vote after midnight gave initial approval to a plan that would give Netanyahu’s coalition more power over who becomes a judge. It is part of a broader package of changes that seeks to weaken the country’s Supreme Court and transfer more power to the ruling coalition.

ISRAELI PROTESTERS TAKE TO STREETS TO BLAST NETANYAHU 'JUDICIAL REFORMS' AS PM CALLS FOR UNITY

Netanyahu’s ultrareligious and ultranationalist allies say these changes are needed to rein in the powers of an unelected judiciary. Critics fear that judges will be appointed based on their loyalty to the government or prime minister — and say that Netanyahu, who faces trial on corruption charges, has a conflict of interest in the legislation.

The showdown has plunged Israel into one of its most bitter domestic crises, with both sides insisting that the future of democracy is at stake in their Middle Eastern country. Israeli Palestinians, a minority that may have the most to lose by the overhaul, have mostly stayed on the sidelines, due to discrimination they face at home and Israel’s ongoing 55-year occupation of their Palestinian brethren in the West Bank.

The legislators cast their votes after a vitrolic debate that dragged on past midnight. During the session, opposition lawmakers chanted, "shame," and wrapped themselves in the Israeli flag — and some were ejected from the hall.

Thousands were rallying outside the Knesset, waving Israeli flags and holding signs reading "saving democracy!" Earlier in the day, protesters launched a sit-down demonstration at the entrance of the homes of some coalition lawmakers and briefly halted traffic on Tel Aviv’s main highway.

Netanyahu accused the demonstrators of violence and said they were ignoring the will of the people who voted his coalition into power last November.

"The people exercised their right to vote in the elections and the people’s representatives will exercise their right to vote here in Israel’s Knesset. It’s called democracy," Netanyahu said, though he left the door open for dialogue on the planned changes.

Israel judicial reform protests

Despite protests, Israeli Prime Minister Benjamin Netanyahu's government is pushing forward with a judicial overhaul. (AP Photo/Ohad Zwigenberg)

The vote on part of the legislation is just the first of three readings required for parliamentary approval, a process that is expected to take months.

Nonetheless, the opposition, including tens of thousands of protesters in front of the Knesset in Jerusalem and in Tel Aviv, saw Monday’s vote as the coalition’s determination to barrel ahead.

"We are fighting for our children’s future, for our country’s future. We don’t intend to give up," said opposition leader Yair Lapid.

Israel’s figurehead president has urged the government to freeze the legislation and seek a compromise with the opposition, a position supported by most polls.

Leaders in the booming tech sector have warned that weakening the judiciary could drive away investors.

The overhaul has prompted otherwise stoic former security chiefs to speak out, and even warn of civil war. The plan has even sparked rare warnings from the U.S., Israel’s chief international ally.

U.S. Ambassador Tom Nides told a podcast over the weekend that Israel should "pump the brakes" on the legislation and seek a consensus on reform that would protect Israel’s democratic institutions.

His comments drew angry responses from Netanyahu allies, telling Nides to stay out of Israel’s internal affairs.

The debate raged Monday from the floor of the Knesset to flag-waving demonstrations in Jerusalem and Tel Aviv.

Simcha Rothman, a far-right lawmaker leading the legislative initiative, presented the proposal to the parliament. Overhead in the viewing gallery, a spectator banged on the protective glass and was carried away by guards.

A fellow Religious Zionism party politician posted a photo on Twitter with Rothman ahead of the vote, celebrating with whisky and sushi.

Last week, some 100,000 people demonstrated outside the Knesset as a committee granted initial approval to the plan. On Monday, the crowds returned, waved Israeli flags, blew horns, and held signs reading "saving democracy."

"All the steps that are going to take place now in the Knesset will change us to a pure dictatorship," said Itan Gur Aryeh, a 74-year-old retiree. "All the power will be with the government, with the head of the government and we’ll all be without rights."

Earlier in the day, protesters launched a sit-down demonstration at the entrance of the homes of some coalition lawmakers and briefly halted traffic on Tel Aviv’s main highway. Hundreds waved Israeli flags in the seaside city and further up the coast in Haifa, holding signs reading "resistance is mandatory."

UN RIPS ISRAEL OVER WEST BANK SETTLEMENT CONSTRUCTION

While Israel has long boasted of its democratic credentials, critics say that claim is tainted by the country’s West Bank occupation and the treatment of its own Palestinian minority.

Israel’s Palestinian citizens, who make up about 20% of the population, have the right to vote but continue to suffer discrimination in areas like the job and housing markets. In the West Bank, Jewish settlers can vote in Israeli elections and are generally protected by Israeli laws, while Palestinians in the same territory are subject to military rule and cannot vote.

The parliamentary votes seek to grant the ruling coalition more power over who becomes a judge. Today, a selection committee is made up of politicians, judges and lawyers — a system that proponents say promotes consensus.

The new system would give coalition lawmakers control over the appointments. Critics fear that judges will be appointed based on their loyalty to the government or prime minister.

A second change approved Monday would bar the Supreme Court from overturning what are known as "Basic Laws," pieces of legislation that stand in for a constitution, which Israel does not have. Critics say that legislators will be able to dub any law a Basic Law, removing judicial oversight over controversial legislation.

Also planned are proposals that would give parliament the power to overturn Supreme Court rulings and control the appointment of government legal advisers. The advisers currently are professional civil servants, and critics say the new system would politicize government ministries.

Critics also fear the overhaul will grant Netanyahu an escape route from his legal woes. Netanyahu has been on trial for nearly three years for charges of accepting bribes, fraud and breach of trust. He denies wrongdoing and says he is the victim of a biased judicial system on a witch hunt against him.

CLICK HERE TO GET THE FOX NEWS APP

Israel’s attorney general has barred Netanyahu from any involvement in the overhaul, saying his legal troubles create a conflict of interest. Instead, his justice minister, a close confidant, is leading the charge.

On Sunday, Netanyahu called the restrictions on him "patently ridiculous."