The evacuation of 2,500 Pakistani and Bangladeshi peacekeepers went off relatively smoothly last week. A force of 1,800 U.S. marines, backed by 400 Italian soldiers, landed on Mogadishu’s main beach and seaport in amphibious assault vehicles and landing craft and quickly set up posts along the sand dunes and rubble-strewn roads bordering the Indian Ocean. Within 48 hours all remaining U.N. troops, with hundreds of tanks and armored personnel carriers, were pulled back behind the American perimeter and put on ships to Dar es Salaam, Tanzania. A feared large-scale assault by militiamen loyal to the warlord Mohammed Farah Aidid never materialized, but at least six Somalis were killed and others wounded when they opened fire on U.S. troops in the final hours of the operation.

As the last marines departed by sea early Friday morning, they left behind a country drifting perilously close to civil war. With no central government in place and an estimated 12,000 militiamen on Mogadishu streets, Somalia’s fate now depends on the willingness of its two most formidable warlords, Aidid and Ali Mahdi Mohammed, to negotiate a power-sharing deal. By last weekend an interclan agreement to jointly administer the port and airfield was still holding. But hard-liners within Aidid’s Habr Gedir subclan were reportedly urging their boss to restart the war that reduced Mogadishu to rubble in 1991-92.

It was a depressing finale for many American troops who remembered more optimistic times in Somalia. In the spring of 1993, Special Forces Sgt. Chan Bell, 39, traveled by jeep across Somalia with a team of Green Berets; they met with at least a dozen warlords in an attempt to create a U.N.-backed national government. Then came the June 5 ambush of U.N. peacekeepers by Aidid’s gunmen. For the next four months Bell patrolled Mogadishu in a helicopter, supervising raids on the faction leader’s suspected hideouts. Bell returned to America days before the Oct. 3 battle in which 18 U.S. Army Rangers died. Again back in Somalia to work alongside the departing Bangladesh command, Bell said he believed the mission had lost sight of larger goals. ““The United Nations pumped in $3 billion and has nothing to show for it,’’ said Bell. ““If something had been done – desalination plants, hospitals, schools – I might feel encouraged. But after we leave, the country will go back to anarchy.''

It is already getting close. At 6 o’clock Wednesday morning, Lt. Col. Kelly Mayes squinted behind a sand dune overlooking Mogadishu airport. Mayes watched as 30 Pakistani tanks rumbled across the tarmac, surrendering control of the airport to the Somalis. As if on cue, hundreds of looters broke through the unguarded gates and ran across the airstrip, prying open steel containers and making off with mattresses, cots and copper wires. Then a dozen technicals – pickup trucks equipped with mounted antiaircraft guns – raced through the gates, shooting over the looters’ heads in an effort to restrain them. A stray bullet whizzed over the dune, inches from Mayes’s head.““I guess that was my birthday gift,‘‘said Mayes, who turned 40 that day.

As the U.N. mission faded into history, a handful of Somali leaders were trying to broker peace. A split has developed within the Habr Gedir between Aidid’s hard-liners and moderates led by Osman Ato, a multimillionaire businessman and the onetime financier of Aidid’s war effort. Now openly critical of Aidid, Ato sent the technicals onto the airstrip to crack down on looters and is trying to enlist militiamen from Ali Mahdi’s subclan to work alongside their Habr Gedir enemy at the port and airfield – a plan that Aidid opposes. Did Ato believe that war could be avoided? ““I think so,’’ he said, ““but Aidid and Ali Mahdi can both be wild.’’ Taming them was too big a job for the peacekeepers. Now it’s up to the warlords’ comrades in arms.