BEIRUT, OCT. 11 -- Palestinian guerrillas repulsed a Shiite Moslem militia counteroffensive today, recapturing two key villages overlooking the sprawling refugee shantytown of Ain Helweh near the southern port city of Sidon.

Seven people, including a 6-year-old girl in Ain Helweh, were killed and 10 wounded during daylong clashes involving rockets, mortars and machine-gun fire, hospital sources said.

Fighters loyal to Palestine Liberation Organization chief Yasser Arafat poured out of Ain Helweh Friday night in a bid to secure a cordon around the refugee camp to protect it from attacks by the Shiite Amal militia.

Amal launched a counterattack shortly after dawn, one day after the Palestinian guerrillas had seized the villages of Baysour and Mharbiyeh, five miles southeast of Sidon.

The Popular Liberation Army, a local Nasserite and Sunni Moslem militia, which had intervened as a buffer force between Amal and the Palestinians, withdrew after fighting resumed today. Mustafa Saad, the leader of the Popular Liberation Army who was entrusted with mediation between the Palestinians and Amal, announced his men were pulling out of the conflict after they clashed with advancing Amal fighters.

Militia officials said the Syrian-backed Amal fighters had established positions commanding the high ground east of Palestinian-held Baysour and Mharbiyeh.

Amal's commander in Sidon, Mohammed Nasser, told reporters this evening that the Shiite militia was attempting to regain control over lost ground, although combat had receded by sunset.

The renewed round of violence dashed hopes for an Amal-Palestinian truce and reconciliation pact that was sponsored by Syria last month and scheduled to go into effect last Monday.

Amal, led by Shiite Cabinet minister Nabih Berri, has repeatedly tried to block the reestablishment of a Palestinian foothold in Lebanon.

Tensions between Amal and the Palestinians have led to major battles with Palestinian guerrillas in refugee camps south of Beirut and in southern Lebanon during the past three years, in which more than 2,500 people have been killed. Amal's actions have previously stirred tensions between it and other Lebanese militias, including the Shiite fundamentalist Hezbollah and the Druze Progressive Socialist Party.

There have been renewed tensions in recent weeks between Amal and the pro-Iran Hezbollah as Amal sought to reassert its authority in south Lebanon over smaller militias.

Amal-Palestinian tension has not yet spread to Beirut, where Syrian troops were deployed last April to help end Shiite-Druze battles and a five-month siege by Amal of Bourj Barajinah and Shatila, two Palestinian camps on the edge of Beirut's southern suburbs.