HONG KONG — Thousands of Hong Kong residents marched on Sunday to observe the 21st anniversary of the territory’s return to China from Britain, a public demonstration of their dissatisfaction with the local government and their fears about the Chinese Communist Party’s growing influence in the territory.

Previously a British colony, Hong Kong was returned to China in 1997 with the promise that it could maintain for 50 years its own political and economic systems, including civil liberties that the Chinese government denies to citizens on the mainland. But many in the city believe that its freedoms and relative autonomy are already eroding.

Organizers said about 50,000 people attended the protest this year, one of the lowest totals since the march was first held in 2003; the police had not released their estimate as of Sunday evening, although the figures from Hong Kong law enforcement tend to be much lower than those provided by pro-democracy groups.

According to some estimates, about 60,000 people participated last year, when China’s president, Xi Jinping, came to Hong Kong to observe the 20th anniversary of the handover, though he left the city hours before the march started.