HONG KONG — Tens of thousands gathered at a central park in Hong Kong on Wednesday to commemorate the 25th anniversary of the Tiananmen Square crackdown, even as a stifling security presence in Beijing and elsewhere in mainland China appeared to forestall protests.

The organizers of the vigil in Hong Kong said the crowd on Wednesday numbered over 180,000, while the police estimated that 99,500 people had attended. The turnout on Wednesday was the largest since 1989, according to the organizers, and the second-largest, according to police estimates, trailing the 2010 turnout, which was 113,000.