Undated (AP) _ By PAUL ALEXANDER Associated Press Writer

MOGADISHU, Somalia (AP) - Everyone was tense as we pulled out of the compound Saturday afternoon at the rear of a three-vehicle convoy.

''There are looters out there,'' we'd been told. ''They have been waiting for you all morning.''

The open car in the middle carried a half-dozen gunmen providing an escort for two Associated Press journalists from the headquarters of faction leader Ali Mahdi Mohamed to the Green Line that splits Mogadishu in half.

It seemed enough protection. On these violent, largely unpatrolled streets, it wasn't.

A Jeep Cherokee, with three AP local Somali staff, was in the lead. It had nearly reached the first intersection when up to 10 men came running around the corner, shouting as they fired AK-47 assault rifles.

The Jeep, hit at least five times, swerved and sped off down the pitted street.

Our Range Rover, which also had three local staff, quickly backed up and roared back into the compound as the carload of escort gunmen apparently chased off the attackers.

As the escort urged us to hurry before the gunmen could return, we pulled out again and accelerated as fast as possible, hunched low in the seats as we passed the intersection. There were no more shots.

Back at the hotel where most journalists stay, the Jeep was nowhere to be found. Nervous minutes later, it arrived. Miraculously, no one was injured, although one bullet tore a hole in the shirt of translator Osman Mahamud Mohamed, 28, who hadn't noticed because he had been firing off a few rounds of his own at the time.

We were lucky. Too often, clashes in Mogadishu end in injury or death these days. With soldiers only patrolling near their compounds, bandits openly carry weapons on the streets, just as they did before a U.S. multinational force arrived and cleaned things up a bit.

Only five months ago, the biggest threats were pickpockets and thieves, along with an occasional carjacking.

Much of the country has improved greatly, but Mogadishu has proved to be the Achilles heel for the United Nations, which took over control of the operation May 4.

North Mogadishu has been free from the clashes between U.N. forces and militiamen loyal to warlord Gen. Mohamed Farrah Aidid that have plagued the southern part of the capital.

But Ali Mahdi's sector also has seen a deterioration in security as patrols have been severely curtailed in the wake on the attacks on U.N. forces by Aidid.

It was unknown whether Saturday's incident was an attempted robbery, carjacking, clan dispute or deliberate attack on two Westerners.