BEIRUT, Lebanon (AP) _ The four Shiite Moslem militiamen darted to the bullet-peppered corner of a cement block building, fired off bursts from their assault rifles, then ran back. Seconds later a grenade exploded at the spot from which they had fired.

The four, members of the Shiite Amal militia, exchanged nervous glances and then sprinted, bent low, across a rubble-strewn street of the west Beirut refugee camp of Chatilla.

At the next ragged corner they made a similar in-and-out pass at Palestinians holed up a few houses away.

This is the war of the alleyways in Beirut's refugee camps, where the Shiites have battled for 25 days to overwhelm Palestinian guerrillas.

It's a hit-and-run war in a wasteland where snipers lurk in ruined buildings. Palestinians and Shiites fight foot-by-foot, in much the same way the Lebanese civil war has been fought on Beirut streets since 1975.

The Shiites and the Palestinians both have lost scores of men in gloomy, darkened alleys that become death traps. Police say more than 560 people have died in the fighting.

With the Palestinians using an underground network of tunnels, grenades appear out of nowhere and take a bloody toll.

''Low, keep your heads low,'' shouted an Amal marksman, firing short, economical bursts through a hole he had made in the wall. ''I almost got you,'' he said to his men in the street.

Amal, backed by the Lebanese army's overwhelmingly Shiite 6th Brigade, overran the Palestinian defenders of the neighboring Sabra camp 10 days ago. They forced defenders of Chatilla into a pocket only about 100 yards square.

However the resistance, centered around a mosque and school, is fierce. The Palestinians have vowed to fight to the last man.

The nights are the worst. Both sides try to infiltrate in the darkness through the shell-blasted houses.

Amal fighters say the Palestinians have used a network of underground tunnels built years ago to sneak in behind Shiite positions. But the Shiites say they now control the entrances and Palestinians are trapped.

Amal launches daily assaults to dislodge the guerrillas from the ruins of the camp's main street.

A red-bereted militiaman clutching a Soviet-made rocket-propelled grenade launcher, the deadliest of the weapons used in the alley battles, joined the four Amal fighters.

He dived for a bullet-riddled green Toyota 10 yards away. On it was scrawled ''Amal - the storm.'' He skidded down on his knees behind it, quickly took aim and fired.

An orange fireball blasted from the launcher. The genade exploded in a pile of rubble where Palestinian snipers were hunkered down.

The four gunmen laughed as they emptied clips from their AK-47 assault rifles into Palestinian positions. When they started taking fire back, they pulled back as the inevitable grenades were lobbed in, sending shrapnel ripping across the steet.

''They're still there,'' the squad leader, panting after his run, reported to his commander. ''Don't know how many.''

''We could sweep them in five minutes, but there are civilians inside the camp,'' said the commander, who identified himself as Haj Khassen.

''They're using the civilians as a shield,'' he said as he sipped a small glass of tea offered in grim silence by an old Palestinian woman.

In between sips, he invited his men to share the tea. A hand grenade exploded outside the next house.

Haj Khassen, 30, speaking through a bullhorn, called on the Palestinians to surrender.There was a stony silence. He sent a Palestinian woman to a nearby guerrilla position with an ultimatum - surrender or die.

The answer was no surprise. Khassen said: ''They told us they're willing to surrender - only if they see (Palestine Liberation Organization Chairman) Yasser Arafat walking down the street with his hands up.''