Drawn up in lines of red and yellow to form stripes with the Catalan colours, hundreds of thousands of flag-waving demonstrators of all ages massed in the sunshine to mark Catalonia's national day, the Diada.
The commemoration, which marks the Spanish conquest of Catalonia in 1714, was more sensitive than ever this year, coming amid calls for a November 9 vote on Catalan independence.
An official from Barcelona's nationalist-led city hall told reporters it estimated turnout for the demonstration at 1.8 million, but central government officials put the figure much lower.
The Spanish government delegation in Catalonia calculated the figure at between 470,000 and 520,000, it said in a statement.
Scotland's September 18 referendum has stirred up Catalans who want full sovereignty for their region in the northeast of Spain, a move fiercely opposed by the central government.
"November 9 we will vote. November 9 we will win," read a banner at the head of Thursday's rally, which filled two converging central avenues in Barcelona.
"Nothing would thrill me more than for my first vote to be for the independence of Catalonia," said one demonstrator, 16-year-old Laura Sanchez Lora.
"Now more than ever, Catalonia needs a state that will defend its language, its culture and its economy," she said, waving a Catalan independence flag: red and yellow stripes, plus a white star on a blue background.
As the V-for-vote formed to the singing of a choir and cheers from the crowd, a girl at the head of the rally placed a paper in a symbolic ballot box.
– Taxes, culture, nationhood –
Spain's national government has branded the November vote illegal and vowed to block it, but Catalonia's regional president Artur Mas has vowed to push on with the plan.
"If a nation such as Scotland can vote, why not Catalonia?" he said in an interview with AFP.
"If the Catalan population wants to vote on its future, it's practically impossible to stop that forever."
He has vowed to pass a regional law that he says will allow Catalonia to hold a "consultation" vote, but his efforts risk being thwarted by Spain's Constitutional Court.
The Diada marks what many in Catalonia see as the day they lost their autonomy: September 11, 1714, when Barcelona fell to Spanish and French forces in the War of the Spanish Succession.
Proud of their distinct Catalan language and culture, many of Catalonia's 7.5 million inhabitants feel short-changed by the national government in Madrid, which redistributes their taxes.
Catalonia formally declared itself a "nation" in 2006 but Spain's Constitutional Court later overruled that claim.
At the height of Spain's economic crisis in 2012, the country's Prime Minister Mariano Rajoy rejected Mas's demand to give Catalonia more power to tax and spend.
Opponents of secession think cutting themselves off from Spain would be an economic disaster.
South of Barcelona in the town of Tarragona on Thursday, the Catalan Civil Society held a smaller rival gathering to denounce independence as a "dead end".
Catalonia accounts for a fifth of Spain's economy but it was hit hard by the financial crisis that began in 2008, fuelling a surge in calls for independence.
"It will not be easy because they will put lots of obstacles in our way, but I think we will manage it," said Lourdes Castellseguer, an 86-year-old woman leaning on a walker at Thursday's demo in Barcelona. "I hope I get to see it."