Israeli fighter-bombers swooped down over a hill 10 miles southeast of Beirut today, knocking out two Palestinian guerrilla bases in apparent retaliation for rocket attacks in northern Israel.

The attack was the closest to Beirut that Israeli planes have struck since April 9 of last year, and the second strafing of Palestinian positions in the Druze-controlled Chouf mountains since the 1982 Israeli invasion of Lebanon.

Police said the Israeli strike killed two Palestinians and two militiamen from the pro-Syrian Druze Progressive Socialist Party, and wounded 11 persons, United Press International reported.

Hospital sources said the only civilian casualty was 5-year-old Lebanese boy who was wounded in the attack.

The Israeli command in Tel Aviv said its pilots reported "accurate hits . . . on an area of terrorist concentrations." It said all planes returned safely, The Associated Press reported. The raid followed overnight rocket attacks on Israel's northern Galilee region, which Israeli military sources, speaking anonymously, confirmed in an Israeli radio report. No injuries or damage were reported.

The Druze-held hills provide the only access route from guerrilla bases in the Bekaa Valley to the Beirut-Sidon coastal highway leading to southern Lebanon. Guerrilla commanders in Ainab said Israeli jets flew over four times and bombed a cement structure used by the radical Popular Front for the Liberation of Palestine and a four-story stone house occupied by the Democratic Front for the Liberation of Palestine.

The air strike came four days after the Popular Front for the Liberation of Palestine and the leftist Lebanese, but Syrian-backed, National Syrian Social Party claimed responsibility for an abortive seaborne attack on Israel's northern border. The Israelis retaliated hours later with air attacks against three guerrilla targets in the Palestinian refugee camp of Ain Helweh 24 miles south of Beirut.

In Ainab, which is on a hillside overlooking Beirut, smoke and dust covered the two destroyed buildings, and there was a strong aroma of burning pines.

Mamdouh Nawfal, an official of the Democratic Front, surveyed the damage as guerrillas salvaged ammunition and flak jackets. A yellow bulldozer worked through the rubble, lifting large stone blocks.

Slabs of concrete and twisted iron rods blocked a narrow road between the Popular Front and Democratic Front buildings. Palestinian fighters carrying walkie-talkies motioned to journalists to leave the area as the hum of Israeli planes returned, drawing antiaircraft fire from joint Druze-Palestinian ground defenses.

Nawfal charged that the Israelis had dropped "1,000-pound bombs and rockets."

Ilham Laaeb, a nurse at a clinic in the mountain town of Baysour, said the clinic had received one Palestinian fatality and 11 others were treated for injuries. The only civilian hurt was a 5-year-old Lebanese boy, she said.