TBILISI (Reuters) – Separatists in Georgia’s Russian-controlled region of South Ossetia on Saturday released a Georgian doctor who was arrested last month for entering the breakaway territory, the state security service in Tbilisi said.

The move came unexpectedly after a court last week handed a 21-month jail sentence to Vazha Gaprindashvili, who colleagues said had been trying to reach a patient in South Ossetia, a region controlled by Moscow since a war in 2008.

“I did not expect my release today,” Gaprindashvili, who is the president of Georgia’s association of orthopedist and traumatologists, told reporters in the Georgian town of Gori.

“I want to thank everyone who worried about me, but especially my beautiful wife and wonderful children,” he added.

Gaprindashvili was taken to South Ossetia’s regional center Tskhinvali on Nov. 9 and held in custody awaiting trial by separatist authorities, who said the doctor had crossed illegally into the territory.

Georgian villagers living near the loosely guarded rural boundary are often detained on similar grounds, but the detention of the high-profile doctor drew international attention.

The U.S. embassy in Georgia, the parliamentary assembly of the Council of Europe and rights group Amnesty International called for Gaprindashvili’s immediate release and the reopening of all crossing points along the South Ossetia boundary.

Hundreds of Georgians, including politicians, staged a rally at the administrative boundary with South Ossetia earlier this month to demand his release.

Russia won a brief war against fellow former Soviet republic Georgia in 2008, after which Moscow recognized two Georgian breakaway regions, South Ossetia and Abkhazia, as independent and deployed troops there.

Russia and South Ossetia signed a deal in 2015 to integrate their security forces.

Reporting by Margarita Antidze; Editing by Jan Harvey