But the six members of the CSTO, other than Russia, - Armenia, Belarus, Kazakhstan, Kyrgyzstan, Tajikistan and Uzbekistan – did not say they would formally recognise the two provinces.
'Show of support'
The joint statement condemning Georgia's attack was a boost for the Kremlin, which has struggled to win international support for its invasion of Georgia after Tbilisi tried to assert control over South Ossetia on August 7.
Russia's relations with the West have deteriorated sharply as a result of the invasion and only a few countries such as Cuba and Venezuela, have backed Russia's position.
The CSTO declaration came after Dick Cheney, the US vice-president, visited Azerbaijan, Georgia and Ukraine in a show of support to their pro-Western governments.
Russia responded to Georgia's attack on South Ossetia by sending troops into the country, where they quickly defeated the Georgian military.
The US and European Union nations have condemned the Russian attack as "disproportionate" and strongly urged Moscow to withdraw its troops from the Georgian territory.
Russia has said that US military assistance to Georgia over the past several years had encouraged Mikhail Saakashvili, Georgia's president, to launch the attack on South Ossetia.
In an apparent reference to a $1bn aid package announced by Washington, Medvedev on Friday warned against providing more assistance to Georgia.
"We don't want Georgia, which acted as the aggressor, to continue to arm itself in an uncontrolled way and with unknown aims and completely unclear consequences," he said.
A US Navy ship anchored outside the key Georgian port of Poti on Friday, delivering tonnes of humanitarian aid to a city still partly occupied by hundreds of Russian troops.