Prime Minister Menachem Begin stunned Israel today by announcing his intention to resign, but he left open the possibility that he could be persuaded to change his mind and remain in the office he has held for five years.

Begin made the announcement during a regular Cabinet meeting this morning, setting off a frenzied effort by other government ministers to persuade him to stay on. In response to their pleas, he agreed not to go through with the resignation at least until after another meeting of government coalition leaders Monday morning.

The reasons behind the surprise announcement were not clear, but there was a consensus that the 70-year-old prime minister, who is in frail health and despondent over the death of his wife in November and the continuing Israeli casualties in Lebanon, was serious about the resignation and was not engaged in a tactical move to counter discontent in the government coalition.

"Menachem Begin is not Machiavelli and when he says something he means it," said Uri Porat, Begin's chief spokesman. But Porat added, "It's not definite. He can change his mind."

Israeli radio quoted sources close to Begin as saying they expected him to go through with the resignation, possibly as early as Monday. This would not, however, necessarily spell the end of Begin's stormy political career unless he decided to leave public life altogether.

Under Israeli law, Begin's resignation would also mean the resignation of his government. But the existing government, its powers somewhat enhanced, would remain in power until a new government was formed--by either Begin or some other leader of the ruling Likud bloc, or by the opposition Labor Alignment.

A resignation could also lead to early parliamentary elections, which are not due until 1985. In either case, the formation of a new government could take weeks if not months.

It was clear from the comments of other Cabinet ministers that they will make a concerted effort to persuade Begin to change his mind. Although for months the prime minister has been reclusive and exhibited little public leadership, in the past he has dominated Israeli politics as few before him and he is considered the key that holds together the often fractious six-party government coalition.

"We believe that Menachem Begin can still contribute to the state and the nation," Deputy Prime Minister David Levy said after the Cabinet meeting. "If it weren't for this belief and the inner conviction of each of us, we would not be acting as we are.

"There may be those who are happy and rejoicing at this moment . . . but I am also completely convinced that in many homes in Israel, in both city and country, there is sadness. But to both these groups I say: It's early yet. We shall continue to strive for Menachem Begin to continue leading the government and the nation."

Porat said Begin's closest aides had known for "a couple of days" of the resignation possibility but were not informed of it for certain until this morning. The Cabinet, however, apparently was caught completely off guard when, at about 11 this morning, after having completed routine Cabinet business, Begin made the announcement.

Porat said Begin offered no explanation for his decision, but Levy said the prime minister cited "personal reasons" without elaborating.

Begin's decision was made public in a terse announcement read to reporters by Cabinet secretary Dan Meridor:

"In the Cabinet session held today, which dealt with various issues, the prime minister informed the Cabinet of his intention to resign from his post as prime minister. Following his announcement, the ministers requested the prime minister to remain at his post, stressing Israel's improving security and political situation. All the ministers spoke, and thus the session ended."

Begin, who looked pale and weak, was among the last to leave the Cabinet meeting, shortly after 1:30 p.m. Normally he travels from his office to his home alone, but today he was joined in the back seat of his gray government sedan by his long-time aide and personal confidant, Yehiel Kadishai.

Later this afternoon, demonstrators organized by Begin's political party, Herut, appeared outside his home to urge him to remain in office. Meanwhile, leaders of the opposition Labor Alignment met in Tel Aviv but decided not to issue a public statement until Begin's intentions are clearer.

Despite the political turmoil the announcement caused, it did not appear there would be any immediate impact on the course of the Israeli government. Defense Minister Moshe Arens said Begin's decision would not affect the plans for the Israeli Army to move from its present positions in Lebanon to a new line along the Awwali River north of Sidon. The partial pullback is expected to take place shortly.

The Foreign Ministry also announced there were no changes in the planned visit here of West German Chancellor Helmut Kohl beginning Wednesday.

According to Israeli radio, Begin told the Cabinet he no longer felt he could function properly as the head of Israel's government. His decision was also reminiscent of his surprise announcement in July that he was abruptly canceling a scheduled visit to Washington to meet with President Reagan.

Then, too, Begin cited "personal reasons" for the decision, but offered no details.

Begin has been a shadow of his previously vigorous self since the death of his wife, Aliza. His own health is frail, and the despondency caused by his personal loss, according to his aides, has been deepened by Israel's continued entanglement in Lebanon and the casualties and domestic turmoil that has caused.

But his aides have also insisted that he has remained alert and able to function in his job and predicted, at least until today, that he would soon reassert himself in a public leadership role.

In all these comments, there was more than a hint that Begin was physically and emotionally worn out, had lost his zest for the job. His long career began as the leader of an underground army fighting the British Mandate authorities in Palestine and continued through almost three decades as a lonely political opposition figure in Israel before he finally achieved the position of prime minister in 1977.

Moreover, the last few months have not been easy for Begin. In addition to the state of his physical and emotional health and the continuing problems in Lebanon, Israel has faced mounting economic troubles that this month led to an abrupt currency devaluation and protracted Cabinet negotiations aimed at cutting the budget and raising revenues by about $1 billion.

As a result of those negotiations, TAMI, one of the small parties in the six-party government coaltion, is threatening to bolt from the government. This gave rise to some speculation that Begin's resignation statement was aimed at forcing the TAMI leaders back into line.

It seemed unlikely, however, that Begin would resort to the dramatic gesture of threatening resignation for this reason. The loss of TAMI's three votes in Israel's parliament, the Knesset, would weaken the government but would not necessarily bring it down, and it is not at all clear that the TAMI leaders are not themselves bluffing in an effort to win more budget concessions for their constituency of Israelis from North Africa.

If Begin does leave his post and public life, his most likely successor as prime minister in the present government is believed to be Foreign Minister Yitzhak Shamir, another of the few remaining Israeli leaders whose political roots go back to the 1940s and the struggle against the British. But Shamir is widely seen as unlikely to remain at the head of the government for long.

Defense Minister Arens, whose stature and popularity have steadily risen since he returned to Israel earlier this year after serving as ambassador in Washington, is not eligible to assume the post of prime minister because he is not a member of the Knesset.

For Begin to resign, he must personally inform President Chaim Herzog of his intention to do so, a step that could occur Monday. By law, Herzog then must consult with leaders of various political parties in the Knesset and ask one of them to try to form a new government.

Herzog could ask Begin or a new leader of the Likud bloc to try to form a new government, or he could turn to Shimon Peres, the leader of the Labor Alignment. In either case, the designated party leader would have 21 days, which could be extended an additional 21 days, to form a new government. There is no legal limit on how often this process can be initiated.

Herzog is a member of the Labor Party who, in a surprise result earlier this year, was elected by the Knesset to a five-year term as president, a largely ceremonial position. He is expected to turn to the political leader he thinks has the best chance to form a new government. Given the makeup of the present Knesset, the candidate is more likely to come from the Likud than from Labor.

Herzog's predecessor, Yitzhak Navon, was also a Labor Party member, but following the extremely close 1981 elections he asked Begin rather than Peres to form a government.

This complex process also could be short-circuited if the present government decides to push through a bill in the Knesset calling for new elections. There was some speculation this could happen if the government fears the Labor Alignment might succeed in putting together an alternative government coalition.

During either of these processes, the current government would remain in power as a "transition government." By law, none of the government ministers could resign during this period and votes of no confidence in the transition government could not be introduced in the Knesset.