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.
Iran has been a central Russian ally in the Middle East, despite considerable tensions between the two. But by renewing dialogue with the West, the new Iranian leadership has chosen another direction. The shifting terrain in the region creates new strategic, political and economic challenges for Russia.