Hong Kong democracy activist Joshua Wong said a court granted him bail on Tuesday so he can appeal a second prison sentence related to 2014's "Umbrella Movement" protests in the semiautonomous Chinese city.

"Hello World. The court approved my bail application," the 21-year-old Wong tweeted after the hearing.

Last week he was sentenced to three months in prison after pleading guilty to a contempt charge for failing to obey a court order to leave a protest camp during the 79-day pro-democracy protests that brought parts of Hong Kong to a standstill.

A two-judge panel at the High Court agreed with Wong's lawyers that the trial judge failed to consider his young age at the time of sentencing, local broadcaster RTHK reported.

In a separate case, Wong has also been granted bail as he appeals a six-month prison sentence at Hong Kong's top court for an unlawful assembly conviction.

Wong was the most prominent of the student activists leading the 2014 protests against Beijing's plan to limit elections for the city's top leader.