Israeli military and civilian officials said tonight that Israel cannot be held accountable for failing to prevent the massacre of hundreds of Palestinians in two West Beirut refugee camps and that the Israeli Army had prevented even more bloodshed.

The state-run Israeli radio, however, quoted military sources tonight as saying that Israeli field commanders in the area were aware of Christian Phalangist fighters gathering to move on the camps, which have been surrounded for several days by Israeli forces, but did nothing to stop them because they thought their target was Palestine Liberation Organization guerrillas they believed to be still in the camps.

Only when the Israelis learned of the apparently indiscriminate killing going on inside the camps did they make efforts to intervene, according to the report.

The Foreign Ministry said Israel "strongly condemns the massacre" and "did everything possible to prevent it from continuing as soon as the IDF Israeli Defense Forces learned about it."

The statement said that Israeli forces "ousted those responsible from the area and even engaged in fighting with extremist Phalangist forces. Israel will continue to do whatever is in its power to prevent such acts between Lebanese and Palestinians from occurring again."

Correspondents in Beirut reported, however, that when they arrived at the scene of the killing -- as early as two hours after it is estimated to have ended -- they found no Israeli presence. They said the Israelis arrived later.

As news of the mass killings reached here, the military command announced that Israeli forces around the refugee camps had been substantially reinforced this afternoon, but said that even the larger force could not guarantee that armed groups of men could be stopped from entering the camps and killing civilians.

Two days ago, the military command announced that Israeli forces controlled "all key points in Beirut" and that the refugee camps "remained encircled and closed." Today, a military spokesman said the earlier statement was never meant to suggest that Israel exercised "air-tight control over access to the camps," adding that the armed Phalangists apparently slipped into the refugee areas without the knowledge of the nearby Israeli forces.

Military sources said Israeli forces maintained quiet at those points where they were stationed and last night had exchanged fire with "extremist Phalangist" units. The sources said that Phalangist militiamen leaving the Shatila camp told Israeli officers that they had engaged in a fierce battle inside the camp with Palestinian fighters and that there had been heavy casualties on both sides.

At that point, according to the sources, the Israeli forces intervened, ordering the Christian militiamen away from the camps and the Beirut airport area where they had first gathered before entering the refugee area.

A senior civilian official expressed bitterness over suggestions that Israel should be held responsible for not having prevented the incident.

"What do they want from us?" he said. "Yesterday the United Nations Security Council, the United States included, asked for the immediate withdrawal of all Israeli forces. Can you imagine what would have happened if we were not there? There would have been thousands of people killed."

The official said the killings inside the camps proved Israel was more than justified in entering West Beirut to prevent anarchy following the assassination of Lebanese president-elect Bashir Gemayel. "Maybe we are not there with enough force," he said.

The official insisted that as soon as Israeli military commanders learned of the mass killings "we did everything we could to stop it. We ousted them the Phalangist militia and closed the whole area as best we could."

News of the massacre jarred the tranquility of the Rosh Hashanah holiday marking the beginning of the year 5743 in the Jewish calendar. A spokesman for Prime Minister Menachem Begin said Begin first learned of the killings from a radio news report today and expressed "shock and astonishment." Begin ordered an in-depth investigation of the killings.

The report of mass killings taking place while the Israeli Army was nearby is certain to increase criticism of the decision by Begin, Defense Minister Ariel Sharon and Foreign Minister Yitzhak Shamir to order the Army into West Beirut following Gemayel's assassination. The opposition Labor Party today demanded a special session of the Israeli parliament to discuss the incident.

While there were conflicting reports on whether the Phalangist militia or forces of Israeli-supported Lebanese Maj. Saad Haddad were responsible for the killings, involvement of either would be likely to increase charges of possible Israeli complicity. The Phalangist militia -- once commanded by Gemayel, whom Israel backed for the presidency of Lebanon -- has been allied with Israel against the PLO and Moslem leftist factions in the country.

Early in the war in Lebanon, it was widely assumed here that Israeli officials hoped the Phalangist fighters would enter Beirut and fight the PLO forces, thus saving Israel from having to take on the undoubtedly bloody task. But with more than 15,000 Palestinian and Syrian fighters trapped in the city, the Phalangists held back and Israel resorted to heavy air, land and sea bombardment to pressure the PLO to withdraw.

When the Israeli Army finally did move into West Beirut early Wednesday, the Begin government said the only purpose was to prevent anarchy and widespread bloodshed in the capital following the Gemayel assassination. But since then, Begin, Sharon and others have stressed their determination to evict about 2,000 PLO guerrillas they say had remained behind.

In recent interviews, senior Israeli military officers have said it has long been obvious to them that the Israeli Army would have to enter the city to eradicate the remnants of the PLO. In an interview published Friday, Chief of Staff Gen. Rafael Eitan said, "We will clean up West Beirut, collect all the arms and apprehend the terrorists, exactly as we did in Tyre and Sidon and any other place in Lebanon. We will identify all the terrorists and their commanders and the area will be clean."

Israel has been under heavy pressure from the United States to withdraw immediately from West Beirut but has so far agreed only to begin discussions with the Lebanese Army about evacuating the positions it holds in the city. The initial reactions of Israeli officials to the reports of the massacre suggested that Israel will stiffen its resolve to remain in Beirut until it is satisfied the Lebanese Army can take control of the city.