Medvedev’s declaration comes as Russian forces remain in Georgia after a war staking out positions beyond the de-facto borders of the separatist regions.
Abkhazia and South Ossetia have effectively ruled themselves following wars with Georgia in the 1990s.
Residents in the Abkhaz capital Sukhumi were jubilant, firing shots into the air and uncorking champagne bottles after the announcement.
Similar celebrations were seen in the South Ossetian capital Tskhinvali.
“We feel happy. We all have tears in our eyes. We feel pride for our people,” said Aida Gabaz, a 38-year-old lawyer.
Russia’s military presence seems likely to further weaken Georgia, a Western ally in the Caucasus region.
It is also a major transit corridor for energy supplies to Europe and a strategic crossroads close to the Middle East, Iran, Afghanistan, Russia and energy-rich Central Asia.
Russian tanks and troops drove deep into the US ally’s territory in a five-day war this month, a move Moscow saw as a justified response to a military threat in its backyard while the West viewed it as a repeat of Soviet-style intervention in its vassal states.
Medvedev said Mikhail Saakashvili, the Georgian president, had forced Russia’s hand by launching an August 7 attack to seize control of South Ossetia by force.
“Saakashvili chose genocide to fulfill his political plans,” Medvedev said.
“Georgia chose the least human way to achieve its goal – to absorb South Ossetia by eliminating a whole nation.”
On the heels of Russia’s first post-Soviet invasion of a foreign country, recognition was another stark demonstration of the Kremlin’s determination to hold sway in lands where its clout is jeopardised by Nato’s expansion and growing Western influence.
Giga Bokeria, Georgia’s deputy foreign minister, described Medvedev’s recognition of South Ossetia and Abkhazia as independent states as an “annexation” by Moscow of Georgian territory.
“This is an unconcealed annexation of these territories, which are a part of Georgia,” Bokeria said.
Alexander Lomaia, the Georgian national security council secretary, said: “This decision has no legal force. Russia will face harsh political consequences from this.”
France, which had brokered a ceasefire agreement to end the fighting between Russia and Georgia, said it regretted the Kremlin’s move.
“We consider this a regrettable decision and I recall our attachment to the territorial integrity of Georgia,” Eric Chevallier, a French foreign ministry spokesman, said.
Condoleezza Rice, the US secretary of state, also called the move “regrettable”.
Russian stocks fell on the decision, as traders worried that it would increase international tension.
The benchmark RTS index, which had already dropped earlier in the session on weak oil prices, extended its losses and was down nearly six per cent.
Earlier on Tuesday, the United States said it intended to deliver humanitarian aid by ship on Wednesday to the Georgian port city of Poti, which Russian troops still control through checkpoints on the city’s outskirts.
While Western nations have called the Russian military presence in Poti a clear violation of an EU-brokered cease-fire, a top Russian general said that using warships to deliver aid was “devilish”.
“The heightened activity of Nato ships in the Black Sea perplexes us,” Col. Gen. Anatoly Nogovitsyn said in Moscow.
“Only yesterday I saw there were nine Nato ships in the sea and by evening another frigate of the US navy passed through the Bosphorus Straits.
“We have also learnt that another eight warships from Nato states are expected shortly.
“They talk about planned exercises and you can probably find some legitimacy in that but … it’s very hard to believe that all the visits so far have been bringing only humanitarian aid,” said Nogovitsyn.
Nogovitsyn insisted that Russia was complying with a French-brokered peace plan while Georgia’s military was rearming.