Gunmen kidnaped a high-ranking Irish official of the U.N. Relief and Works Agency today, raising fears of a resumption in abductions of westerners in the Moslem-controlled sector of the Lebanese capital.

Aidan Walsh, 46, the deputy director of UNRWA, which runs relief and educational programs for Palestinian refugees, was intercepted by armed men in two cars as he was being driven to work at 7:20 a.m. along the seafront Corniche. When his Palestinian driver protested, the kidnapers put a gun to his head and smashed the windshield of his car with the butt of a Kalashnikov.

The abductors, dressed in combat fatigues, pointed a gun at Walsh's chest. Two of them seized him by the arms and another pushed him from behind into the back seat of a car after he had been ordered out of his own, which was flying a U.N. flag.

Walsh is the second UNRWA official to be grabbed at gunpoint in Lebanon and the 12th foreigner known to have been kidnaped this year. On March 25, British journalist Alec Collett, working as an information consultant for UNRWA, was abducted just south of Beirut. He was the last of nine westerners to disappear here in March and until today, no more abductions had been reported.

Islamic Jihad, a mysterious group believed to be a front for extremist fringes of the Shiite Moslem community, or others who would like to drive westerners out of Lebanon, sent Beirut's major newspapers color photographs of six of the kidnaped westerners and demanded release of convicted Moslem terrorists imprisoned in Kuwait, United Press International reported.

The pictures, published Thursday in several Beirut dailies, were of four Americans, William Buckley, an embassy political officer; Terry Anderson, the Beirut bureau chief of The Associated Press; the Rev. Lawrence Jenco, head of Catholic Relief Services here, and of the Rev. Benjamin Weir, a Presbyterian minister. The other two photos were of two French diplomats, Marcel Fontaine and Marcel Carton. There was no indication when the pictures were taken.

Jihad also claims to be holding a fifth American, Peter Kilburn, a librarian at the American University of Beirut and a Saudi diplomat.

The frequency of such kidnapings, which peaked in March, prompted an exodus of westerners, especially among U.N. personnel involved in relief activities.

Both UNRWA officials and Irish diplomats here said they doubted that Walsh's abduction, for which no group has claimed responsibility so far, would lead to a pullout of foreign staff members.

Walsh arrived in September to help clear up corruption at UNRWA. He was described as a tough administrator who does not shy away from disciplining personnel. Last year, an Irishmen and a Briton from UNRWA left Lebanon after receiving threats from local employes affected by a crackdown on abusers of UNRWA property.