EILAT, Israel (AP) _ A lone gunman slipped across the Egyptian border Sunday and ambushed a bus and three military vehicles, killing four Israelis and wounding 27, the army said.

The attack was the third from Arab territory in two days. At least four Palestinian guerrillas were killed and two Israeli soldiers injured in incidents in Israel's self-declared security zone in southern Lebanon and off the Mediterranean coast.

The dead in the border attack, three soldiers and a civilian bus driver, were shot on a road running along the Israeli-Egyptian border about 15 miles northwest of the Israeli Red Sea resort of Eilat, the army said. It said most of the wounded were civilian workers at an Israeli air base.

The gunman, who used an automatic rifle and was described as wearing a uniform, escaped back into Egypt. He was shot by an Israeli security guard and trailing blood, the army said.

An Israeli army patrol chased him, firing, but did not pursue him across the frontier, the army said.

A senior Egyptian security source in Cairo said an Egyptian border policeman stationed in the area had been arrested as the suspected assailant.

Israel army radio said the assailant's blood-stained flak jacket with ''Allah'' written on it was found in the area. It said the attack was claimed by the Moslem fundamentalist group Islamic Holy War-Jerusalem in a statement issued in Amman, Jordan.

Israeli and Egyptian reports said the attacker was armed with the Soviet- designed Kalashnikov assault rifle.

Karen Golan, 12, who was on the bus, said: ''I was sitting next to my father, near the back door. Suddenly we saw a bus half on the road, half in the wadi, and an army van.

''A man came out as though he was flagging us down for help. The driver slowed down and stopped and then the man opened fire.

''My father grabbed me and told me to put my hands around my head and get on the floor.''

She was slightly injured above the eye by fragments. Her father was unhurt.

Israel television showed a woman named Rachel Fishbein, telling a relative on the telephone that she had seen a passenger's fingers blown off by bullets. ''We just lay there. Don't ask what happened,'' she sobbed.

Prime Minister Yitzhak Shamir called on Egypt to capture and punish the assailant, and prevent further attacks.

Egyptian Foreign Minister Esmat Abdel-Meguid called the attack ''very regrettable'' and said he hoped it would not affect relations between the two countries.

Egypt and Israel have been at peace since 1979, and the border is less heavily defended than other Israeli frontiers.

In another attack Sunday, a Lebanese woman carrying explosives killed herself and injured two Israeli soldiers in Israel's self-proclaimed security zone in southern Lebanon, army reports said. The Syrian Socialist Nationalist Party, claimed responsibility for the attack and said 12 Israeli soldiers also were killed.

On Saturday, a navy gunboat attacked a dinghy off the Lebanese coast that officials said was headed to attack Israel. The five guerrillas aboard were killed, the army said. The Popular Front for the Liberation of Palestine- General Command, a radical PLO faction, said Sunday its guerrillas were on board the boat. It said four were missing but that one swam to shore.

Also Sunday, a pipe bomb exploded at a bus stop in the Jewish sector of Jerusalem but no one was injured, police said.

In the attack at the Egyptian border, a brigadier general identified only by his first name, Dubi, said the assailant ''lay in wait on the roadside.'' The assailant's first two victims were soldiers driving alone in military vehicles, the army said. The third was driving an empty bus and apparently thought an accident had occurred, stopped and was shot at close range.

Finally, the attacker fired on a red-and-white bus of the Egged national bus company that was carrying civilian workers at a nearby air base. A security guard on board was wounded but then managed to shoot the attacker, Dubi said.

''We found signs of blood showing that he was hit. I think this prevented a heavier tragedy,'' he said. ''The terrorist apparently intended to board the bus and take it over.''

Bus passenger Rachel Amor said the man did not look Arab, and wore a khaki- colored uniform like that of Israeli forces. He was ''putting ammunition into his gun,'' she said.

It was the second such attack this year. On Feb. 4, gunmen ambushed an Israeli tour bus in Egypt, killing nine Israelis and wounding 20. The Egyptian government says the gunmen have since been arrested, and has hinted they are Palestinian.

An army spokesman said of the 27 wounded Sunday, one soldier and eight civilians were hospitalized in Eilat and the Negev desert town of Beersheba. News reports said their wounds were minor to moderate.