HONG KONG—Demonstrators staged the biggest rally challenging China’s authority over the city since Britain ceded control in 1997, marching through streets for hours to protest a proposed law that would let Beijing take people across the border to stand trial in the mainland.

Organizers estimated more than a million people—almost one for every seven residents in the city—took to the streets to demand the city’s leaders and their political masters in Beijing shelve the law. Police estimated 240,000 protesters took part at the...