BARCELONA—Hundreds of thousands of pro-independence demonstrators clogged the streets of Barcelona on Friday, launching a campaign to elect a separatist majority to Catalonia’s regional parliament this month and set the stage for an attempted split from Spain.

The huge rally underscored the capacity of a unified separatist movement to mobilize its followers—in a close election with high stakes for all of Spain—against an array of pro-union parties, whose banners were scarcely in evidence here on the wealthy region’s annual...