Hong Kong's highest court freed pro-democracy activists Joshua Wong and Nathan Law on bail Tuesday pending an appeal of their prison sentences after they were convicted of sparking massive protests in 2014.

The two were granted bail by the Court of Final Appeal, according to a post on their political party's Facebook page and supporters outside the courthouse.

In August, the two along with a third student leader were given prison sentences of six to eight months for unlawful assembly related to the "Umbrella Movement" protests.

The three had been already been given more lenient sentences that allowed them to avoid prison but the justice secretary requested that the courts review those punishments.

The move sparked fears that authorities were undermining the semiautonomous Chinese city's independent judiciary, underlining concerns among residents that Beijing is clamping down on dissent.

Wong was given six months and Law received eight months. They were among student leaders who helped spearhead the protests, which brought major thoroughfares in Hong Kong to a standstill for 79 days.

Local broadcaster RTHK reported that the judge required each to post 50,000 Hong Kong dollars ($6,400) for their bail, surrender their travel documents and report to police once a week.