So far only Nicaragua has joined Russia in recognizing the two republics. Moscow said recognition was a necessary step to protect the republics after last month's conflict.
"The government of Somalia will be preparing documents as swiftly as possible on the establishment of diplomatic relations with South Ossetia, as well with Georgia and Abkhazia," Mohamed Handule said.
Recognition of a state is a pre-requisite to the establishment of diplomatic relations.
Russia recognized South Ossetia and Abkhazia as independent states on August 26 after a brief war with Georgia, which attacked South Ossetia to bring it back under central control on August 8.
Belarus and Venezuela have signaled support for Russia's recognition of the republics, but have not yet followed suit.
Handule also said Somalia, which enjoyed the former Soviet Union's backing in the 1970s when it was proclaimed a socialist state, hopes to launch military and technical cooperation with Russia.
"We want Russia to start military and technical cooperation with our country as soon as possible. Active talks are currently underway between our countries' foreign ministries on Russia's assistance in training Somali border guards, combat units, and security services," he said, adding that he hoped the Russian Defense Ministry would soon engage in talks.
Somalia has been without an effective central government since President Siad Barre was overthrown in 1991. The country, which emerged as an independent state comprising a former British protectorate and an Italian colony in 1960, has for years been plagued by territorial and religious disputes. It has struggled to cope with famine and disease that have had a heavy death toll.
Earlier on Wednesday, the diplomat said Somali President Abdullahi Yusuf Ahmed has allowed Russia's military to fight pirates off Somalia's coast and on land.
Add to blog
You may place this material on your blog by copying the link.
Image Galleries: Yury Gagarin: A down-to-earth person
Infographics: The Linguistic Diversity of the Planet
Europe is not an alien civilization to Putin. If the Russian world wins, the European family would likely offer a place – possibly the pride of place – to a new and better Russia, with its large population consisting of many ethnic groups. By incorporating Crimea, Russia has not left Europe but has re-entered it after 20 years of living in isolation.