President Mohammed Siad Barre of Somalia says rebellious army officers who tried to overthrow his government Sunday killed 20 persons and wounded 34 others.

Siad Barre said loyal forces, who quelled the rebellion in a few hours, captured the majority of the plotters, and that the others were on the run and being hunted down. Siad Barre's remarks were in a message of congratulations Tuesday night to Somalia's army on its 18th anniversary. The text was broadcast yesterday by Mogadishu Radio.

"The objective of the traitors . . . was to hand over the country to colonialism and blow the nation's stability sky high," Siad Barre said. He did not identify the foreign country the plotters supported, but a coup attempt by hardline supporters of the Soviet Union had been expected for some time.

Diplomatic sources in Mogadishu said there has been growing discontent among the Somali Army units that were withdrawn from the Ogaden war in the face of formidable international pressure last month. The failure of the coup attempt was believed to have strenghtened the Somali leader's position by demonstrating that he still enjoys the support of the majority of the army.

Vice President and Defense Minister Mohamed Ali Samantar, meanwhile, denied reports that 80 officers had been executed following the coup attempt, although he confirmed that six officers were executed after being condemned for "crimes against the state."

In Peking, it was announced that Siad Barre will visit China on Friday in the first top-level Somali mission there since China openly took Somalia's side in the conflict with Ethiopia, Diplomatic sources said they viewed the visit as a significant development in the Horn of Africa conflict and in Sino-Soviet relations because it underscores an increasing openness in China's support of Somalia.

In Djibouti, Agriculture Minister Idris Farah said the number of refugees arriving from Ogaden conflict has reached more than 30,000, or 10 per cent of the territory's total population.

Farah said the situation in Djibouti was been growing more difficult, with 20,000 refugees, mainly of Somali origin, in the city.