Prime Minister Menahem Begin warned today that Israel might withdraw its compromise peace plan if Egyptian President Anwar Sadat presses his demand for full evacuation of the Sinai.

Begin, in harsher language than he has used toward Sadat in some time, strongly critized the Egyptian president for his repeated statements that no Israeli soldier or civilian could remain in the Sinai after the signing of a comprehensive Middle East peace settlement.

The criticism, made in a speech to his own hawkish Herut faction of the Likud Party, was generally interpreted here, however, as a move by Begin to strengthen his own political position and not necessarily an indication of a setback to the peace initiatives that began with Sadat's trip to Jerusalem late last year.

The israeli Cabinet, after six hours of stormy debate, voted earlier today to uphold Begin's decision to allow no new settlements to be constructed in the Sinai.

The vote, which rejected Agriculture Minister Ariel Sharon's plan to establish 24 new civilian and military settlements before the next round of Israeli-Egyptian talks, endorsed Begin's policy of merely "strengthening the existing settlement" there.

Sadat, questioned by reporters in Khartoum, Sudan, where he was ending a two-day visit, condemned both Sharon's proposal for new settlements and any plans to keep the present settlements.

"We shall not agree to the presence of any Israeli soldier or civilian after a comprehensive agreement is signed," Sadat said. "Let us hope that they will reconsider their position."

Sadat, according to news reports from Aswan, where he went after leaving Sudan, said meanwhile, that he could accept a five-year transition period for administration of the occupied territories leading to self-determination for Palestinians.

He was responding to questions about President Carter's suggestion yesterday that a possible interim solution to the Palestinian problem could be the creation of a joint administration - with Israel, Jordan, the Palestinians and maybe the United Nations - for the West Bank and Gaza Strip, now occupied by Israel.

Sadat said that while he supported self-determination, this could take place over a period of time, possibly "five years or so."

Although Begin's criticism of Sadat was in harsh contrast to the mood that followed Sadat's visit here, sources in Jerusalem said tonight that it should not be interpreted as a serious setback to the peace efforts.

Just as Sadat is having troubles in the Arab world, the sources pointed out, Begin is having trouble selling his own peace plan in Israel and his remarks were made to his own Herut colleagues, some of the more hawkish of whom are accusing Begin of giving too much away to the Egyptians.

Both leaders may find it necessary to take strong stands during the coming peace negotiations, but this does not mean that the basic understanding between Begin and Sadat has been destroyed, sources said.

In his speech, Begin declared that, "With all due respect and friendship, I must tell President Sadat that this display of inflexibility and stubbornness will not change our position."

The Israeli plan, which Begin said had U.S. backing, envisioned the retention of some Israeli settlements in the Sinai to be protected by Israeli forces after sovereignty had been returned to Egypt.

The whole issue of Israel settlement in the Sinai has become a major domestic issue during the last few days. In its vote today, the Israel Cabinet decided to "strengthen the existing settlements" in the northern Sinai and near Sharm el Sheikh in the south "by extending the end for agriculture and increasing the civilian population," Cabinet spokesman Arieh Naor announced. He said the plan to keep certain Israeli settlements in the Sinai has been "made known" to Sadat when he last met with Begin.

Naor said that there was no decision to inaugurate new settlements in the Sinai and be emphatically denied recent press reports that the government had ever decided to establish four new civilian settlements and 20 outposts, manned by the military, in the Rafiah region between the Gaza Strip and the northern Sinai.

The Cabinet decision is being interpreted here as a setback for Sharon, who is on record as recommending crash settlements in the occupied territories as protection against Arab infiltration in the event of Israeli withdrawals.

Another major setback for Sharon was the Cabinet's decision not to include him as a member of Israel's political committee, headed by Foreign Minister Moshe Dayan, which will begin negotiations with an Egyptian delegation here Jan. 16.

A military committee, under the leadership of Defense Minister Ezer Weizman, will fly to Egypt on Wednesday to negotiate with the Egyptians.

The Cabinet decision not to include Sharon in the political committee was also seen here as a political setback for Begin, as it was he who had proposed Sharon for the job. Although the Cabinet's decision to increase and strengthen existing settlements in the Sinai could be seen as a compromise to the settlers and to the rising Israeli reaction and fear that Begin has offered too many concessions too soon in the Sinai, it will not go unchallenged.

Informed sources said that the Democratic Movement for Change, which constitutes the second biggest party in the ruling coalition, was against strengthening the settlements at this time of delicate negotiations and would challenge the decision in Parliament's Defense and Security Committee.