Three Hong Kong student protest leaders have avoided prison time for taking part in an illegal rally that sparked pro-democracy street protests two years ago.

A magistrate sentenced Joshua Wong, Nathan Law and Alex Chow to community service on Monday.

Chow also received a three-week prison sentence, suspended for a year.

The three were found guilty last month of participating in an illegal assembly.

Nineteen-year-old Wong became the most high-profile leader of the protests that erupted in late September 2014, which marked the former British colony's most turbulent period since China took control in 1997.

Youthful protesters occupied key thoroughfares for 11 weeks to press demands for unrestricted elections for the city's top leader.