Somalia has warned Cuba and other unnamed nations to stay out of the fighting between Ethiopian troops and pro-Somali forces in the Ogaden, a disputed region of southeastern Ethiopia.

If foreign forces become involved, "What was an African war will change into an international conflict," Radio Mogadishu said late last night.

The Soviet Union, meanwhile, took a more openly pro-Ethiopian stand in the conflict as the government daily Izvestia criticized "foreign intervention" in Ethiopia.

Izvestia called Ogaden "part of Ethiopian territory" and criticized "armed intervention in Ethiopia's domestic affairs, even on the specious, pretext of implementation of the principle of self-determination."

Previous Soviet expressions of support for Ethiopia have been worded so they did not criticize Somalia even indirectly. Both countries are recipients of Soviet arms.

Somalia's warning to outsiders to stay out of the fighting followed a charge by a Somali diplomat last week that 5,000 to 9,000 troops from a foreign force were on their way to Ethiopia. He did not specify their nationality, but most observers were convinced that he meant Cubans. U.S. sources have estimated that about 50 Cubans are in Ethiopia as military advisers.

Somalia asserted that it "has the right to go to the defense and rescue of western Somali people if foreign troops attempt to crush" the Western Somali Liberation Front, a guerrilla force fighting in Ogaden.

"Cuba and any other nation that plans to interfere in exclusively African matters should desist from doing so and leave the settlement of African quarrels to the Organization of African Unity" and the United Nations, the Somali radio said.

Somalia has repeatedly denied any active involvement in the Ogaden, but it backs ethnic Somali guerrillas who seek to annex it to Somalia.

Ethiopia said today that its missiles shot down two Somali Mig-17 fighters and its warplanes destroyed numerous tanks and military vehicles carrying Somali troops. It said 16 Somali Mig-17s and Mig-21s have been destroyed in the past three weeks.

Somali's official newsagency said that captured Ethiopian soldiers deny their government's claims that regular Somali forces are fighting in Ogaden.