Prime Minister Benjamin Netanyahu on Wednesday appealed for restraint from all parties involved in the ongoing saga surrounding a segregated girls' school in the West Bank settlement of Immanuel.

"At this critical moment, when Israel faces existential threats from our enemies, I call on all sides in the matter to show restraint, respect the law and solve the problem peacefully and amicably," Netanyahu said in a statement.

Israel Police are preparing for mass demonstrations on Thursday by ultra-Orthodox Jews, who plan to protest the High Court of Justice ruling two days earlier that threatened to jail defiant parents who refuse to desegregate the ultra-Orthodox Beit Yaakov school.

Police plan to deploy 10,000 officers across Israel in an effort to curb violence and keep the peace.

The High Court had earlier in the year instructed the school to figure out a way to run classes for both Ashkenazi and Sephardi girls without segregating them.

Jerusalem District Police Chief Aharon Franco on Wednesday approved a request from an ultra-Orthodox umbrella group to stage a protest in Jerusalem on Thursday in the wake of the High Court ruling.

Police will allow 20,000 demonstrators to gather in Jerusalem. The protest is planned to start at 1:30 P.M. on Yirmiyahu Street, from which the protesters will march to the jail within the city's Russian compound, where the defiant parents will be detained if they refuse to implement the court ruling to desegregate the school.

The demonstrators' procession is expected to pass through Yirmiyahu Street, Bar Ilan junction, Shmuel HaNavi and Shivtei Israel Streets on to Zmora Street, where the protest will be held. Alternate streets in the surrounding area will be closed from 1 P.M. until 5 P.M.

On Tuesday, the panel of justices headed by Edmond Levy ruled that the parents, all Ashkenazim, must notify the court by Wednesday of their intention to implement an earlier High Court ruling that required their daughters to share classrooms and teachers with peers of Sephardi origin. Failure to do so would result in a two-week jail term.

Police Commissioner David Cohen was expected to conduct a briefing on Wednesday to present ways to enforce the High Court ruling.

"The police are urging ultra-Orthodox community leaders to show responsibility and ask their community to exhibit restraint," a police spokesperson said.

Throughout the day on Wednesday mediators worked to get the Education Ministry, petitioners from the Noar Kahalacha nonprofit organization, which appealed to the High Court, and the parents to reach a compromise.

The discussions have focused mostly on reaching a deal to be implemented during the next school year and on the parents' request to open a new school in the settlement that would get limited government funding but be more autonomous.

Shas spiritual leader Rabbi Ovadia Yosef 'shocked'

Meanwhile, Shas spiritual leader Rabbi Ovadia Yosef on Wednesday made his first comments about the High Court ruling, saying, "I am shocked by the petition to the court." Rabbi Ovadia, whose son Rabbi Ya'akov Yosef is one of the petitioners against the school, is to decide Thursday whether to join the join the protests against the High Court ruling.

Earlier on Wednesday, a heated debate took place in the Knesset about the segregated school, one day after the High Court ruling on the matter.

MK Moshe Gafni (United Torah Judaism), who met with Prime Minister Benjamin Netanyahu and Justice Minister Yaakov Neeman, told the Knesset: "We, the ultra-Orthodox community, will not respect rulings, not of lower courts and not of the High Court, that contradict the Torah."

Gafni went on to say that there is an opportunity to prevent the parents from being jailed. "These pictures [of the parents being jailed] will be published worldwide and there will be no escape from thinking about what happened in other countries at other times when ultra-Orthodox Jews with side locks and beards went to jail."

Education Minister Gideon Sa'ar told the Knesset that court rulings must be respected, even when one disagrees with their content.

"I still this issue will be resolved," Sa'ar said. "I think the solution isn't that difficult or complex, especially since we are talking about a school year that ends in two weeks. I don't see a reason not to implement this ruling."