A historic demonstration sent what organizers said were nearly two million people pouring into Hong Kong’s streets on Sunday.

They came to show their opposition to a proposed law that would extend the reach of China’s judiciary into Hong Kong among other demands, capping a week of protests that have convulsed this city of around 7.4 million.

But...