Lebanese President Amin Gemayel narrowly escaped death today when shells struck the main wing of the presidential palace shortly before he was due to leave for a summit meeting with Syrian President Hafez Assad in Damascus.

The president was saved by "a miracle and the powers of God," state-run Lebanese television said. Gemayel was having lunch when the shelling started, and a Soviet-made Sagger guided antitank missile hit his office and reception hall adjacent to the dining room, causing extensive damage and a fire.

It was unclear who fired on the palace or whether Gemayel was the intended target. Two shells also exploded near the residence of U.S. Ambassador Reginald Bartholomew, police reported. One wall was damaged, but there were no casualties, the State Department said.

In another development, an anonymous caller speaking on behalf of the Islamic Jihad said his group was responsible for the abduction yesterday of David Jacobsen, the director of the American University Hospital, and the killing of a British professor at the American University of Beirut, whose body was found today.

Denis Hill, 52, a professor of English, was found yesterday with four bullet holes in the back of his neck, British Embassy officials said.

The fire at the palace took 45 minutes to extinguish, and the shells shattered the glass facade. Security sources said the Sagger missile was fired from a tall building in the southern suburbs. The Army returned fire, destroying the top floors of the building, Lebanese television said.

One palace guard was injured, and the president was taken by helicopter from the palace in suburban Baabda, five miles southeast of Beirut, to Larnaca, Cyprus, where he boarded a plane to Damascus for talks with Assad. Radio stations reported that Gemayel and Assad will discuss the possibility of a wider Syrian role in Lebanon as Shiite-Palestinian warfare continued into its 11th day.

Palestinian gunners entrenched in hills above Beirut, meanwhile, lobbed shells and rockets into the mainly Shiite southern suburbs after attempts by the Shiite Amal militia to advance into the besieged Palestinian camp of Burj al Barajinah.

Police said that at least 24 persons were killed and 108 wounded in fighting Wednesday, The Associated Press reported. That raised the known casualty toll since May 19 to 413 killed and 1,863 wounded.

Wednesday, Amal released 105 of the estimated 2,000 Palestinians it has rounded up in Beirut, apparently at the behest of Arab governments. It said in a statement that others will be freed gradually but gave no other details.

The caller claiming to speak for Islamic Jihad said Hill, the British professor, "died when he tried to escape from our men questioning him on some suspicious activities he was undertaking in Beirut."

The secretive group also claimed to have kidnaped French journalists Jean-Paul Kaufman and Michel Seurat, who disappeared last week on their way from the airport to Beirut.

The caller warned "foreign nationals present in our areas to respect Islamic hospitality and not exploit their presence among us to undertake acts of espionage or subversion." The caller said that Jacobsen had traveled two weeks ago to the United States "supposedly to attend a medical conference, but we have other information."

Jacobsen was seized by six gunmen in a blue van outside the university yesterday as he was walking to his office accompanied by a Lebanese doctor. He became the sixth American to be kidnaped in the Moslem-controlled sector of Beirut since March of last year.

"We shall not let anyone rest until our brothers are released from the cells of Kuwait and until America and France stop helping Iraqi President Saddam Hussein in his repeated attacks against the Islamic Republic Iran ," the Islamic Jihad statement said.

Islamic Jihad has offered to spare the American hostages and two French diplomats that it claims to be holding in return for the release of 17 of its comrades detained in Kuwait on bombing charges. However, Kuwait has rejected the demands.

The hostages are Terry Anderson, the bureau chief of The Associated Press; the Rev. Benjamin Weir, a Presbyterian minister; the Rev. Lawrence Jenco, director of the Catholic Relief Services; Peter Kilburn, a librarian at the American University of Beirut, and William Buckley, a political officer at the U.S. Embassy. The French victims are diplomats Marcel Carton and Marcel Fontaine. Journalists Seurat and Kauffman were added to the list today.

The Islamic Jihad caller charged that the United States and France had encouraged Kuwait's attitude in refusing to release the prisoners and colluded with the Iraqi regime to strike civilians in Iran.

The surge in kidnapings and threats to foreigners has added to an atmosphere of tension in the capital, despite reports that the Syrian-Lebanese summit may pave the way for the return of Syrian troops to Beirut.

About 30,000 Syrian troops are in central and northern Lebanon. A redeployment of the Syrian troops, first dispatched to Lebanon in 1976 under an Arab League mandate, is seen by many factions in Lebanon as a necessary stabilizing element.