Israel's national unity government faced its first serious internal threat today as a small religious party bolted from the government coalition in a dispute over the allocation of Cabinet positions.

The Sephardic Tora Guardians (Shas) Party, rebuffing appeals by Prime Minister Shimon Peres, left the government with the resignation from the Cabinet of its leader, Yitzhak Peretz.

The Shas Party holds only four seats in Israel's 120-member parliament, and its departure alone could not bring about the disintegration of the three-month-old national unity government. But Shas is allied with and supported by the Likud bloc, one of the two principal partners in the unity coalition, which also threatened to leave the government if a compromise is not found.

Likud ministers in the Cabinet scheduled a meeting for Thursday to decide their next step.

"Now we are facing a crisis," Foreign Minister Yitzhak Shamir, the Likud leader, told reporters following a meeting of coalition representatives today at which the Shas decision to bolt became final. Shamir said the Likud and Shas had made "the maximum concessions to settle the crisis," but that all of their "far-reaching solutions" had been rejected by Peres' Labor Alignment, the other major party in the government.

Asked if the government was in danger of falling over what is essentially a fight between two small religious parties over patronage and control of religious budget allocations, Shamir replied: "The government is in danger."

Shamir cut short by one day a trip to South America and returned to Israel this week to take part in frantic last-minute efforts to resolve the dispute and prevent the first open rupture in the national unity government. He said today that he expected other Likud ministers who are out of the country, including Ariel Sharon, who has been in New York since early November for the trial of his libel suit against Time magazine, to return for the meeting of top Likud officials later this week.

In New York, however, Sharon expressed little concern about the developments in Israel and said he would not return until next week when his trial is recessed for Christmas, Washington Post correspondent Herbert H. Denton reported.

Sharon said that "the responsibility for the present crisis is the Labor Party's," and he warned that "the Likud must be strong and firm even if that means the dismantlement of the national unity government." But he said he saw little immediate cause for concern.

If the Likud goes through with its threat to follow Shas out of the government, the Labor Alignment would face a difficult task in forming a new government with the other parties in parliament. It was because last July's elections left both Labor and the Likud unable to form a government with their natural allies that the two main parties finally agreed to share power and formed the national unity government in September. Thus today's move by Shas could lead to a second round of national elections in Israel in less than a year.

But even as Shas bolted today, Labor Party officials continued to express optimism that the government would be preserved. "All the needs that created this government are still there," said Moshe Shahal, Labor Party energy minister.

The dispute has been building since the government took office. It centers on a tug of war between Shas and the rival National Religious Party, for control of Israel's Interior and Religious Affairs ministries.

During the post-election negotiations last summer, Shas, a new party of orthodox Jews from Middle Eastern and North African countries, was promised the Religious Affairs Ministry by the Likud. Labor promised the National Religious Party, once Israel's dominant religious party but now in decline, that it would retain control of both Religious Affairs and Interior as it had in the previous Likud-led government.

When the unity government was formed, Peres finessed these contradictory pledges by temporarily assuming control of the two disputed ministries while promising to work out a solution. The arrangement he arrived at recently would give the larger and more powerful Interior Ministry to Shas, while allowing the National Religious Party to remain in charge, as it has since Israel was created in 1948, of the Religious Affairs Ministry.

However, the National Religious Party demanded and won from Peres an agreement to transfer control of the budgets of local religious councils from Interior to Religious Affairs. Shas balked, insisting that it must play some role in religious affairs in the government.

Seeking to preserve the agreement, Peres met late Saturday night with the Shas Rabbinical Council, four rabbis who set the party's policies. The next day, however, Peretz submitted his resignation as a minister-without-portfolio.