All Cubans living in Somalia left the country yesterday, less than 48 hours after the Somalis broke diplomatic relations with Havana.

"We're kicked the buggers out!" a can as 44 Cuban diplomats, technicians and their relatives left on a flight to Aden, South Yemen.

"Dosvedanya (goodbye)", Cuban Charge d'affaires Roland Gallardo shouted in Russian to a group of Eastern European diplomats at Mogadishu airport.

Somalia announced on Sunday that it was breaking its ties with Cuba and also ending a treaty of friendship and cooperation with the Soviet Union that was signed three years ago.

The Somalis accused the two countries of planning a joint attack on the Somalia from neighboring Ehtiopia, where Somalia has charged that Cuban troops are fighting alongside Ethiopian troops in the struggle against Somalian forces over Ogaden Province.

The Soviet Union yesterday blamed the collapse of its treaty with Somalia on what it called "chauvinist, expansionist moods" of the Somali government.

Tass, the Soviet news agency, broke the official silence here on Somalia's decision and, for the first time since the outbreak of the Ogaden desert conflict, it accused Moscow's former ally for waging war against Ethiopia.

Tass said: "Essentially, behind this action lies dissatisfaction because the Soviet Union did not support Somalia's territorial claims on a neighboring state and refused to facilitate the stirring of fratricidal war in the horn of Africa."

Western diplomats who follow Soviet policy toward Africa said the Kremhn had clearly recognized the risk of alienating Somalia through its now alliance with Ethiopia, but evidently believed initally that it could preserve good relations with both countries.

"The Soviet gamble has not paid off," one diplomat said.

The 4,500 Soviet advisers who were ordered out have another five ways to pack their bags and shut down their missile and naval bases.

This article was compiled from news dispatches.