Officials say they need to amend the law before July so that they can extradite a murder suspect to Taiwan.
Demonstrators – some marching with umbrellas – fear Beijing is trying to exert more power over the territory.
Police estimate that about 22,000 people took part, while organisers say this figure was closer to 130,000.
Either way, these estimates would make it the largest demonstration since pro-democracy rallies in 2014 known as the Umbrella Movement.
Reuters news agency reported that people were chanting “step down, Carrie Lam”. Ms Lam is the pro-Beijing leader of Hong Kong.
Hong Kong has a separate legal system to mainland China, thanks to “one country, two systems”.
The former British colony was handed back to China in 1997 on condition it would retain “a high degree of autonomy, except in foreign and defence affairs” for 50 years.
But earlier this year Ms Lam’s government announced that it would overhaul the city’s extradition laws so that, for the first time, suspects could be extradited to Taiwan, Macau or mainland China on a case-by-case basis.