Dozens of security men filed into the garage, Kalashnikovs slapping at their thighs. Over steaming platters of lamb and rice, members of the Palestinian Authority's military intelligence and armed forces gathered to reconcile after a traffic dispute had escalated into an hour-long shootout in the street.

"We are brothers," said Maj. Gen. Moussa Arafat, head of the authority's military intelligence agency in the Gaza Strip, who called the meeting at his house June 14. "When such small issues come up, I implore you to resolve them through dialogue."

Despite the welcoming words, his men ate standing up, and many rested one hand on their weapons. Reconciliation is routinely brokered here, and just as routinely broken.

Since the Palestinian uprising began in September 2000, a handful of armed groups fighting Israel have also fought one another for dominance in the 138-square-mile Gaza Strip. The Palestinian Authority, given responsibility for governing Gaza a decade ago, runs a dozen security agencies whose members shoot at rivals -- and each other -- every few weeks. The armed branches of organizations such as the Islamic Resistance Movement, or Hamas, and Islamic Jihad assert their power and increasingly are beyond the Palestinian Authority's control. Independent armed gangs also roam the streets, imposing their will.

At the same time, the deadlocked Israeli-Palestinian peace process and the strong military measures Israel has taken in the occupied territories have eroded the power of political institutions, Palestinian legislators say. In the resulting vacuum, "the military wings of all these political parties decide what they're going to do vis-a-vis political decisions," said Marwan Kanafani, a Gaza representative to the Palestinian Legislative Council.

The most powerful force in Gaza has been the Israeli army, which has thousands of troops stationed here. But as Israel contemplates a unilateral withdrawal of troops and Jewish settlers from the Gaza Strip, Palestinians, Israelis and foreign observers have voiced fears that such a move would spark a civil war among Palestinians, permit a takeover by Islamic militia forces or simply dissolve into total chaos.

"When the Israelis leave Gaza it is going to cause us a very, very, very big problem," said Sami Abu Samhadaneh, who is head of the Special Office of the Palestinian Authority's security services, a branch charged with gathering intelligence on the other security agencies. He is also connected to a militia made up of defectors from some of the dominant Palestinian factions.

Efforts to avoid upheaval have focused on stabilizing the security situation and forging some sort of accord among factions that would bring about cooperation rather than chaos. Egypt has offered to take a leading role in the effort; Israel, the United States, the European Union, Russia and the United Nations have expressed support.

To succeed, however, Egyptian negotiators must engineer compromises among armed groups that have been empowered by the volatile security situation; some of the groups may see more benefit than risk in greater chaos, observers say.

"Hamas and the warlords are the ones who will decide what will happen," said Palestinian pollster and analyst Khalil Shikaki.

In Gaza City, armed men sit on stoops and lean in doorways, surveying, smoking, telling jokes. Many of them work for the Palestinian Authority's security services, which combined are the largest employer in Gaza, providing 30,000 jobs, according to security agency chiefs. A search is underway to find a new structure to organize the often-chaotic forces.

Under the Oslo peace accords, the Palestinian Authority was established in 1994 to create interim security forces that were expected to suppress militant groups and provide internal policing. Palestinian leader Yasser Arafat, whose Fatah movement dominates the authority's legislature and ministries, set up a complex, overlapping and shifting system of eight to 12 agencies. Each had separate chiefs in the West Bank and Gaza, and all the chiefs were directly responsible to Arafat, who personally oversaw security for both places. The idea was to stop any individual from rising to prominence and threatening Arafat's power. Often, analysts said, Arafat would issue conflicting orders to different agencies.

During the Palestinian uprising, or intifada, some members of the authority's forces fought Israeli soldiers, and Israel struck back at most of the agencies in the West Bank and Gaza. In a recent interview, Samir Mashrawi, a Fatah member and negotiator in talks among agencies and factions, listed each Palestinian Authority security branch whose Gaza office was hit by Israeli forces: intelligence, preventive security, police, navy, the presidential guard, military intelligence and the border forces.

Isolated in his crumbling compound in the West Bank city of Ramallah since early 2002, Arafat seemed to lose control of the security situation in Gaza. Subordinates turned against chiefs, and agencies turned against one another. Some even dared to defy Arafat.

Mohammed Dahlan, a native of Gaza's Khan Younis refugee camp, emerged as a powerful figure as the Palestinian Authority's chief of preventive security in Gaza. Dahlan resigned in 2002 during tensions over the perceived threat he posed to Arafat. When the Palestinians' first prime minister, Mahmoud Abbas, appointed Dahlan security minister, Arafat refused to give up control of most of the security agencies. Abbas quit after four months, and Dahlan again found himself out of an official job.

Yet Dahlan remains a major figure among Gaza's various bosses. He has many supporters in the U.S. and British governments, and Israel considers him a plausible future leader in Gaza.

"He's very charismatic. . . . From our perspective he's a good candidate to take control. I don't see any other guy on the Palestinian side who can take control," said David Hacham, a colonel in the Israeli army reserves who is Prime Minister Ariel Sharon's adviser on Arab affairs. "But he can't do it alone. The key to reforming the security bodies is the will and agreement of Arafat."

In an interview in his villa office, Dahlan called for "total change" in the security apparatus. The eight to 12 security agencies should be streamlined into three, he said, a formula that is also part of Egyptian-Israeli-American plans for security in Gaza after an Israeli pullout.

Rashid Abu Shbak, Dahlan's successor as chief of preventive security, talked about similar changes. In his office, Abu Shbak got out a square of paper and sketched a plan for security restructuring. He wrote "army," "intelligence" and "police" at the top of the page. Under each, he listed the security forces that could be brought under those branches.

In fact, said Abu Shbak, this was similar to the official structure of the current system. But he conceded that the Palestinian Authority hierarchy was influenced more by Fatah loyalty, family ties and shared prison terms in Israel than by official positions.

Egypt wants restructuring to bring the chain of command closer to Abu Shbak's sketch and put the whole apparatus under the power of an interior minister. As an incentive to Arafat, the Egyptians also are offering help in guaranteeing stability in Gaza after an Israeli withdrawal. Egypt has volunteered to train and advise the Palestinian security agencies, partly by sending 200 consultants to Gaza, and has invited the various Palestinian factions and security leaders to Cairo for a "national dialogue." The condition is Arafat's commitment to security reform.

But Arafat has answered with his own reform plan, insisting that he remain in control while appointing a longtime loyalist, Maj. Gen. Abdel Razek Majaida, to a new post as security chief. And last month, Hamas and nine other Palestinian factions united to issue a statement opposing Egyptian intervention in Palestinian affairs.

Shifting Loyalties

On a quiet day in Gaza, nothing is quite so palpable as where one cannot go. Intercity roads are blocked by Israeli military checkpoints or piles of rubble dumped to prevent vehicles from passing. Tanks are parked by the side of the road and occasionally shoot at targets that do not always seem clear. The borders with Egypt and Israel are closed.

The restrictions on movement have intensified over more than 31/2 years of armed conflict between Israel and the Palestinians. Gaza residents hold Israel directly responsible for their plight, but many also blame the Palestinian Authority for failing to provide basic peace and security.

According to a poll conducted by the Gaza-based General Institute for Information, 94 percent of Palestinians questioned say they live in lawlessness and chaos. A January report by the political committee of the Palestinian Legislative Council, describing a recent deterioration in security, noted a "lack of activity of policemen and security forces that has created a security vacuum that causes citizens to be terrorized by murder, theft, assaults and general lawlessness." The report used a phrase that has come into popular use among Palestinians to sum up the situation: a "chaos of weapons."

"This phenomenon cannot be controlled," said Abu Shbak, the preventive security chief in Gaza, unless Israeli forces withdraw and Gazans no longer bear arms.

But Hacham, the Israeli adviser, said Palestinian passivity is fueling the chaos. "The basic problem is that the Palestinians are not ready to take the necessary actions, taking into consideration that these actions are bringing about rifts in Palestinian society and organizations," he said.

Among Gazans, popular support has shifted toward other organizations eager to fill the vacuum.

The charities of Hamas have long provided medical care for the sick, food for the hungry and homes for the homeless. Its armed wing has bolstered the group's popularity with attacks on Israeli targets. And Hamas appears to be more cohesive than Arafat's Fatah movement and more attractive to some Palestinians because its leaders seem to eschew corruption while pressing the fight against Israel.

Polls show support for Hamas growing from 15 percent to 25 percent of Gazans surveyed in the past four years, placing it ahead of any other group, including Fatah.

"Hamas delivered what the public wanted: violence," said Shikaki, the Palestinian pollster. "Every time the Israelis attacked, with every checkpoint, every incidence of humiliation and injury, the control shifted to Hamas."

At times, tensions among rival factions have seemed to threaten civil war. But Mashrawi, the Fatah member who has also been a key negotiator among factions, said many Palestinian leaders have a long history of working together, such as when they shared Israeli prison cells and negotiated to keep order. They are also capable of negotiating some form of shared governance, he said.

But unity has yet to be achieved. Hamas says it will continue to fight Israel until Israeli forces have withdrawn completely from Gaza, a stance other Palestinian leaders warn could lead to a further swing into chaos during early phases of any withdrawal. And even if Hamas and the Palestinian Authority were to agree jointly to a cease-fire with Israel, as many as 20 percent of the factional fighters in Gaza would be unlikely to abide by it, Mashrawi estimated.

The factional talks that were cut off in the spring resumed June 13 with four Hamas members and four representatives of Fatah, according to Mashrawi, who attended. By the end of that week, Hamas had publicly demanded a share in the government. In the past, the group, which opposed the Oslo peace accords, rejected all participation in the authority.

But in a year when overtures to peace have shown halting progress, the violence they are intended to overcome has scarcely paused. Palestinian armed groups have attacked one another with such frequency that the incidents rarely make headlines. One exception was in February, when five men shot their way out of police headquarters in Gaza City, killing one policeman and injuring 10. The attackers were members of a preventive security squad formed in the 1990s to pursue militants fighting Israel.

Abu Samhadaneh, the Palestinian Special Office chief, said too many institutions were created because of the Israeli-Palestinian conflict and have thrived during the current uprising. As useful as they have been in the fight against Israeli occupation, he said, their continued existence helps keep the Gaza Strip volatile.

"We need an enemy to fight against," he said. "Struggle is something clean. Politics is dirty."

Members of the Palestinian Authority's intelligence forces and army attempt to reconcile over lunch after an hour-long shootout on a Gaza City street.