Israeli warplanes attacked an alleged Palestinian guerilla training base nine miles south of Beirut yesterday, the first raid so near the Lebanese capital in 18 months.

Washington Post correspondents in Beirut and Jerusalem reported that the Israeli military claimed the raid inflicted heavy damage on the camp while a Lebanese spokesman said antiaircraft fire forced the 20 planes to jettison their bombs off target.

An unspecified number of civilians were wounded, the Lebanese spokesman said.

It was the first Israeli air attack in Lebanon since Aug. 20, when the Air Forced bombed a Palestinian stronghold at Beaufort Castle near the southern border. Prime Minister Menachem Begin said the raid conformed to the Israeli policy of striking first "to prevent the terrorists for coming and killing Israeli citizens." Recent incursions have been by land or sea.

Palestinians in Beirut have charged that Israel is using the diversion of the Iraqi-Iranian war to widen its assaults into Lebanon. The Lebanese premier, Selim Hoss, asked while watching the raid from his suburban Beirut home, "Do those who compete in supporting Israel have anything to say as it fires its guns?"

The comment was a clear reference to the U.S. presidential candidates' use of the Israeli issue in the current campaign, correspondent David B. Ottaway reported from Beirut.