Hong Kong dissident and former legislator Leung Kwok-hung - nicknamed 'Long Hair' - emerged victorious in a high court ruling Friday after suing the city's correctional services for cutting his eponymous locks.

Leung, 64, was jailed for four weeks in 2014 for his role in the Occupy Central movement and had his head shorn against his will during processing by prison guards as a safety measure designed to enforce social norms, according to the department of corrections.

But Friday the Hong Kong Court of Final Appeal ruled unanimously that Leung's haircut was in violation of sexual discrimination laws.

"The fact that male prisoners are denied a choice as to their hair length suggests that they are treated less favorably than female prisoners," the judges said in their decision.

The ruling marks the final chapter in a three-year legal saga. Leung first filed his case in 2017, when the Court of First Instance ruled in his favor. This was overturned by the Court of Appeal in 2018 but the original verdict was reaffirmed Friday.

"As I fought this case, I saw how the correctional department had treated male and female prisoners unfairly in their right to haircuts," the longtime activist told the media outside the courthouse.

Leung's long gray hair has grown out again since his now-notorious brush with the prison shears and he took a moment Friday to reflect on the citywide social problems that have also taken root in the past four years.

"There are too many things that are unjust in Hong Kong," he noted. "We are facing too much political injustice that cannot be resolved in courts."

The city's judiciary, which until now has been a common law stronghold, is under threat of CCP-influenced reforms - a prospect that led UK Foreign Secretary Dominic Raab Monday to hint at the withdrawal of British justices from Hong Kong courts.

"It would cause huge reputational damage to Hong Kong that the Foreign Secretary believes British judges can no longer come here without participating in a compromised system," Hong Kong Bar Association chairperson Philip Dykes told Business Times in an interview Wednesday.

But Raab's concern is understandable. The recently passed National Security Law has quashed freedom of speech, while the disqualification of four opposition legislators in early November effectively neutralized the city's pan-democratic political bloc.

Authorities are also cracking down on dissidents - three of Leung's activist compatriots were remanded into police custody this week for their involvement in a siege at police headquarters in Wan Chai last year.