JERUSALEM  Tens of thousands of ultra-Orthodox Jews took to the streets of this city on Thursday to accompany dozens of Hasidic parents who were on their way to prison for two weeks after refusing to comply with a Supreme Court ruling against ethnic segregation in their children’s school.

This latest battle in Israel’s simmering culture war, pitting ultra-Orthodox Ashkenazim of European origin against their slightly less stringent ultra-Orthodox Sephardic peers from Arab and North African backgrounds, has raised accusations of racism on one side and infringement of religious freedom on the other.

But on Thursday, most ultra-Orthodox were united in protest against what they see as the state’s meddling in their religious affairs and in their conviction that the religious law of the Torah  or at least their interpretation of it  transcends that of any Israeli court.

Men in black coats and hats filled an ultra-Orthodox neighborhood, blocking main roads and hailing those going to prison as if they were holy martyrs. Banners waved with slogans like “Don’t touch the Messiah,” while people looked down from rooftops.