Israeli infantry and paratroop units killed at least 40 Palestinian guerrillas and sustained losses of three dead and 12 wounded today in the biggest attack into Lebanon since the Litani River invasion of March 1978, military authorities said.

Officials said that 40 guerrillas were known dead, and that the actual figure may be considerably higher.

In Beirut, a Palestine Liberation Organization spokesman said 12 of its guerrillas were killed and 14 wounded in the battle and put Israeli losses at 30 dead. However, local and medical sources in south Lebanon said 25 Palestinian guerrillas and Lebanese leftists were killed and another 25 wounded, Washington Post special correspondent Nora Boustany reported.

At the United Nations, Secretary General Kurt Waldheim issued a statement deploring the attack and appealing to all parties to cooperate with the world body in its efforts to fulfill its peacekeeping mandate in the region. A small unamanned U.N. observation post was reported destroyed by Israeli air strikes during the attack.

A spokesman for Waldheim said the commander of the U.N. Interim Force in Lebanon (UNIFIL) protested to Israeli authorities over the attack.

In Washington, the State Department expressed "concern" at the "rising tensions and violence" in the area and called on all parties to "act with restraint." While department spokesman David Passage did not condemn outright the latest Israeli commando raid, he said the Pentagon was undertaking an investigation to determine whether American weapons were being used illegally by Israel in its raids on Palestinian forces in Lebanon.

Israeli aircraft bombed a PLO stronghold in the Beaufort Castle, a crusader -- era ruin just north of the Litani River long used to shell the narrow corridor along the Israeli border controlled by Christian militias.

A Palestinian military commander in the south Lebanon town of Nabatiya told reporters that American-built F16 fighters were used in the attack, Post correspondent Boustany reported from Beirut.

The battle involved two hours of fierce close-in fighting in five locations about five miles across the border and was preceded by a massive artillery barrage from inside Israel. Israeli army units destroyed Palestinian mortar and artillery emplacements, blew up armored vehicles with recoiles rifles and dynamited buildings used as staging bases and headquarters for terrorist raids, according to Maj. Gen. Joshua Saguy, chief of military intelligence.

Lebanese and Palestinian sources in Beirut said 500 to 600 Israeli soldiers were involved in the attack. Israeli military officials would give no figures regarding the size of the raiding force, however.

Three Palestinian guerillas were captured and held for questioning as the incursion units were airlifted out of southern Lebanon by helicopter.

Prime Minister Menachem Begin, who also acts at defense minister followed the predawn operation from a command headquarters in northern Israel, staying all night until Israeli forces had withdrawn.

On the other side, PLO guerrilla chief Yasser Arafat presided over the Palestinian defense operations upon his return from a meeting of Islamic states in Casablanca, Moracco, Boustany reported. Arafat again this morning inspected Palestinian positions that came under attack and visited wounded fighters in guerrilla-run field hospitals.

Israeli intelligence chief Saguy, in a briefing for foreign correspondents, said the army units slogged, across the narrow and shallow Litani, climbed steep hills to the Arnoun Pleateau, northeast of Metulla, for about five hours before reaching PLO targets in Arnoun, Hama Arnoun, Tibnit, Mazraat Tahar and Jebil Tahara.

Israeli army officials would not disclose what route they took to reach the target area. However, according to a map issued by the army and purporting to show the direction of the thrust, the troops would have had to pass through an area controlled by a Nepalese battalion of the U.N. peacekeeping force in Lebanon.

Saguy said that Israeli intelligence had shown the PLO area to have been on alert for three weeks in apparent anticipation of the attack.

He said there had been 60 attempts by Fatah, the main military wing of the PLO, and Saiqa, the Syrian-linked guerrilla organization, to infiltrate Israel in the last two months, compared to 20 attempts in the previous two-month period.

The purpose of the attack, he said, was to disrupt the guerrilla staging areas and knock out artillery batteries used to shell the enclave controlled by Christian militia leader Maj. Saad Hadded. The militias are supported by Israel.

About 200 Palestinian guerrillas were in the target areas hit, according to Israeli estimates, and a total of 1,500 are believed to be in the area stretching from Beaufort Castle to Nabatiya. The army claimed that all the targets were outside densely-populated civilian areas.