Tens of thousands of Israelis from across the country poured into this city tonight to demand that the government of Prime Minister Menachem Begin resign because of the massacre of Palestinian refugees in Israeli-occupied West Beirut. Security officials said it was the largest rally in the country's history.

The organizers of the protest, the Israeli Labor Party and other opposition political organizations, said the crowd numbered 350,000, but estimates of the size of the demonstration varied. The crowd appeared to have been larger than 100,000 persons but smaller than 350,000.

Speaking from a platform bedecked with Israeli flags, Labor Party leader Shimon Peres said the Beirut massacre showed that the Begin government "does not represent the people of Israel." He called for the convening of a State Judicial Board of Inquiry, the most powerful kind of investigative panel, to study Israel's role in the massacre.

Peres demanded that Israel withdraw its forces from Lebanon, and other speakers, including former prime minister Yitzhak Rabin, called on Begin and Defense Minister Ariel Sharon to resign.

The Begin government, which holds that Israel bears no responsibility for the massacre of hundreds of men, women and children, has been resisting the convening of a judicial board of inquiry.

Yesterday, under intense domestic pressure, the Israeli Cabinet asked the president of the Israeli supreme court to investigate the massacre. But the judge, Yitzhak Kahan, turned down the request because the court has pending before it two cases demanding that the higher-level board of inquiry be established.

The Cabinet thus must face the issue under increased pressure when it next meets on Tuesday.

For blocks around the central Square of the Kings of Israel, the streets were clogged with cars and buses that brought sign-waving Israelis to the rally from every corner of the country. Police arrested 20 progovernment counter-demonstrators who tried to disrupt the rally, but the crowd generally was peaceful.

Interviews with members of the crowd, although overwhelmingly anti-Begin, revealed the deep split in Israeli society that has been brought to the forefront by the Beirut massacre.

Joseph Millis, who said he was discharged from the Army two weeks ago after serving in Lebanon, said, "We have killed enough, conquered enough and destroyed enough in this war. Why, we don't know."

A 15-year-old boy, however, said Israel was right to send the Christian militia units into the Palestinian refugee centers, in order to save the lives of Israeli soldiers. He said he did not care about the children who had been killed in the massacre "because even those small children will be murderers some day."

In a sign of the racial hatred that divides this society, some antigovernment members of the crowd insulted the dark-skinned Sephardic Jews from North African and Middle Eastern countries who form the bulwark of Begin's support.

There is no question that the massacre has damaged the Begin government and mobilized the political opposition, but there have been no public opinion polls published in Israel since the incident to measure the extent of antigovernment feeling.

One of the many signs at the rally said, "We are all Eli Geva," a reference to the Israeli Army tank commander who asked to be relieved of his duties in July rather than lead his troops into Beirut, where he feared a high toll of Israeli and civilian casualties.

Geva chose today to break his public silence on the war. He said in interviews that there were other officers who shared his sentiments but chose not to speak out. He also said he knew that the Israeli government had been close to ordering a fullscale assault on West Beirut this summer.