FILE PHOTO: An ultra-Orthodox Jewish man walks near a food store which is open "24/7" in Tel Aviv, Israel September 20, 2016. REUTERS/Baz Ratner/File Photo

JERUSALEM (Reuters) - Israel’s parliament passed legislation governing trading on the Jewish Sabbath by a one-vote margin on Tuesday, a vote that has angered secular lawmakers while earning a reprieve for Prime Minister Benjamin Netanyahu’s coalition.

The bill, passed by a 58-to-57 vote, affords Israel’s interior minister the right to cancel municipal by-laws that local councils may wish to enact to allow the opening of shops and restaurants in their areas during the Sabbath.

Most, but not all, Jewish-run shops and supermarkets have traditionally remained closed in Israel during the Sabbath, which runs from sunset on Friday to sunset on Saturday. The number of open establishments varies according to the religious nature of the area.

The legislation, promoted by Interior Minister Aryeh Deri of the ultra-Orthodox Shas party, would affect new establishments wishing to open their doors during the Sabbath, but current norms would not be influenced.

Shas and another ultra-Orthodox party have angered Israel’s secular Jewish majority by trying to limit Saturday trading and threatened to leave Netanyahu’s coalition, which could have caused it to collapse had the legislation failed.

The successful vote was the latest of several motions brought by right-wing coalition members who feel able to pressure Netanyahu’s brittle government, which has a slim parliamentary majority, to enact hard-line legislation.

Netanyahu told his Likud faction in parliament on Monday that any vote against the legislation would be a vote of no-confidence in the government. The Israeli leader is also beset by two corruption investigations, in which he denies wrongdoing.

At least one member of his own Likud party refused to vote for the motion and was threatened with expulsion. Members of other coalition factions also refused to vote for it.

Defence Minister Avigdor Liberman, leader of the ultra-nationalist and secularist Yisrael Beitenu faction, said his party would not back the motion and he called the bill “absurd”.