HONG KONG — The appeal of democratic ideas drew thousands of protesters into the streets of Hong Kong on Tuesday in a defiant but largely peaceful march advocating free and open elections for the territory’s chief executive.

A nearly solid river of protesters, most of them young, poured out of Victoria Park through the afternoon and into the evening, heading for the skyscraper-lined canyons of downtown Hong Kong, Asia’s top financial center. There, hundreds staged two sit-ins past dawn, prompting the police to remove and arrest 511 people on charges of obstructing the police and unlawful assembly.

Shouting slogans in Cantonese such as “change comes from the people,” the demonstrators largely stood their ground even after the police warned them that they were in violation of the law. Through the day, the protesters showed their determination by waiting unflinchingly and with barely a complaint under a succession of deluges for a chance to walk through downtown Hong Kong, carrying banners calling for the introduction of full democracy and reading “Say No to Communist China.” And even as organizers boasted of record crowds, they insisted that the protest was merely a dress rehearsal for much larger sit-ins that may happen this year if the Chinese government refuses to allow free elections in this former British colony.