BARCELONA — The world’s attention may be riveted on Scotland and its secessionist drive, but Thursday was Catalonia’s turn, as hundreds of thousands of flag-waving citizens rallied in the streets in what Catalan leaders hoped would be the prelude to the region’s own vote on independence from Spain.

In central Barcelona, Catalans formed a giant V — for vote and victory — by filling two of the city’s main avenues and draping themselves in the red-and-yellow colors of the Catalan flag. The demonstration coincided with Catalonia’s National Day, but it had all the feeling of a pre-independence celebration.

As Scotland’s push for independence enters its homestretch before a referendum on Sept. 18 on whether to break from the United Kingdom, Catalonia’s secessionist drive, too, has reached a critical phase with its own vote approaching on Nov. 9. The outcome is likely to be influenced by what the Scots decide.

But unlike in Scotland, where British leaders have belatedly tried to persuade Scots not to leave while not threatening to block the vote, Catalonia’s secessionist drive is veering dangerously toward a constitutional crisis.