Russia's Supreme Court on Wednesday ordered the release of an opposition activist who was the only person in the country jailed under a tough law against public protests.

Ildar Dadin, 34, was sent to prison in 2015 for repeated unsanctioned protests against President Vladimir Putin's rule after the introduction of controversial legislation critics say was aimed at stamping out demonstrations.

The Supreme Court responded to a request by prosecutors to free Dadin and ruled that his sentence should be quashed and his case closed.

The court ruled that he has the right to ‘rehabilitation,’ meaning compensation from the state.

Dadin -- who was declared a prisoner of conscience by Amnesty International -- has complained of torture and abuse behind bars, and his case became a cause celebre for those opposed to Putin.

He was originally sentenced to three years in jail, but that sentence was reduced and he had some six months left to run, meaning Wednesday's ruling is largely symbolic.

During his time behind bars Dadin accused guards of beating and abusing him and was repeatedly shifted between far-flung facilities.

Dadin's lawyer Ksenia Kostromina said she hoped he would be officially released from the penal colony in Siberia where he is being held ‘very soon’.

‘Now I can go to (the Siberian city of) Barnaul to meet him,’ Dadin's wife Anastasia Zotova told the Dozhd independent channel.

She said she hoped to move abroad with Dadin, adding: ‘I'm very afraid they will release him now and the next day they will arrest him again.’

- 'Repressive law' -

Dadin's case was controversial as it was the first time a protester was prosecuted under 2014 legislation that ratcheted up punishment to a maximum of five years in jail for anyone caught holding unsanctioned rallies more than twice in a 180-day period.

The law -- known as Article 212.1 -- was seen as part of the Kremlin's attempt to curb dissent in response to mass protests against Putin in 2011-2012 and demonstrations in Kiev that ousted Ukraine's Russian-backed leader in 2014.

Wednesday's decision came after Russia's Constitutional Court this month ordered a review of Dadin's case, saying that punishment should be proportional to the danger to the public and that protesters should only be jailed after rallies that were not peaceful.

The Constitutional Court did not go so far as to say the law was unconstitutional, focusing on the fact that Dadin had faced criminal charges before rulings on his protests had entered force.

Rights groups hailed Dadin's release and said they hoped the authorities will now stop applying the controversial legislation to peaceful demonstrations.

‘We can only welcome the ruling,’ Alexander Artemyev, Amnesty's spokesman in Moscow, told AFP.

‘Now we hope this repressive law... will no longer be used against people staging peaceful protests.’

Human Rights Watch's Russia director Tanya Lokshina called the move ‘a tremendous victory for Russian civic society’ and said she hoped officials ‘will be apprehensive’ about applying the law in future.

Kremlin spokesman Dmitry Peskov said ‘any court decision should be respected, all the more so one of the Supreme Court’, but gave no more details.

Leading Russian opposition politician Alexei Navalny -- who spearheaded the mass protests in 2011-2012 -- called Dadin's release ‘excellent news’ but said that the harsh sentence had already taken its toll.

‘It is important to remember that they held an innocent man for one and a half years in prison and tortured him,’ Navalny wrote on Twitter.

Since the introduction of the law any major protests against Putin have become almost impossible in Russia.

Related Story