JERUSALEM — Israel’s Supreme Court has ordered the government to either reinstate the Western Wall agreement with non-Orthodox groups or explain why it should not force the state to honor the deal.

“One can’t help but ask ‘What exactly happened here?’” Chief Justice Miriam Naor said at a hearing Thursday. “There was an agreement, they were working on it. But then the government came and said there isn’t one. It raises some questions.”

The hearing was in answer to a petition filed by the liberal Jewish movements in Israel and the Women of the Wall calling for the implementation of the agreement to expand and upgrade the egalitarian prayer section at the southern end of the Western Wall. The agreement puts the upgraded section on equal footing with the single-sex sections; it would be run by a special committee with no input from the Chief Rabbinate.

In June, the Cabinet suspended the deal passed in 2016 negotiated by the Reform and Conservative movements, the Women of the Wall, the Jewish Agency for Israel and the Israeli government. The government’s haredi Orthodox coalition partners pressured Prime Minister Benjamin Netanyahu to scrap the agreement.

The government has said it plans to go forward with the expansion of the egalitarian section despite the freeze.

“The court sent a clear message to the government that it is their responsibility to reconsider their position about freezing the Western Wall agreement,” Rabbi Gilad Kariv, executive director of the Reform movement in Israel, said in a statement. “We continue to be committed to the compromise and hope that the Prime Minister will understand the message of the Supreme Court judges.”

Women of the Wall chair Anat Hoffman said, “As we were negotiating the agreement we felt at times that we were making history. Today proved that feeling to be right. That feeling proved itself right today. The Agreement is the guiding light in the Court’s path to a just solution to the Kotel dispute.”

Last week, Israel’s Chief Rabbinate said in a brief filed with the Supreme Court that the court lacks the jurisdiction to rule on the “intrareligious” struggle involving egalitarian prayer at the Western Wall.