The Georgian officers were arrested overnight as they were driving in a car. The South Ossetian authorities said they were identified as artillery officers and therefore were prohibited access to the territory, open only to peacekeepers.
"The four Georgian servicemen detained by Interior Ministry forces early on Tuesday have been released," said Igor Alborov, deputy defense and emergency situations minister of South Ossetia.
Georgia's president had ordered the country's Interior Ministry to prepare for an operation to free the officers.
"I order the police to prepare for an operation to immediately release the kidnapped servicemen. I warn the abductors too," Mikheil Saakashvili said.
Mamuka Kurashvili, the chief of the Georgian Defense Ministry's peacekeeping operations staff, said earlier Tuesday the four were visiting friends near the conflict zone.
"When they were returning, an armed gang of Ossetians and North Caucasus militants abducted the four officers," he said, adding that the men were being held illegally.
South Ossetia declared its independence from Georgia following the collapse of the Soviet Union in 1991, resulting in a bloody conflict that killed hundreds of people. The pro-Western Georgian leadership has said it is determined to bring the breakaway region, along with the rebel region of Abkhazia, back under Tbilisi's control.
The frozen conflicts have recently surfaced with shootouts reported in South Ossetia and a series of bomb explosions in Abkhazia in the past 10 days. The separatist regimes have accused Tbilisi of being behind the attacks.
Russia, whose peacekeepers have been stationed in the conflict zones since last decade's hostilities, angering Georgia's pro-NATO government, was set to raise the issue of escalating tensions in the secessionist republics at a UN Security Council session Tuesday.