Shouting “freedom” or “independence” and carrying candles, the demonstrators stood massed on a large boulevard in the city centre at nightfall before observing a moment of silence.
Around 200,000 people took part, a spokesman for Barcelona's municipal police said.
Candle-lit demonstrations were also held in Girona, Reus and other Catalan cities in protest at the Madrid-based National Court's Monday ruling to keep Jordi Cuixart and Jordi Sanchez behind bars pending investigations into sedition charges.
“They want us to be afraid so we stop thinking of independence, but the opposite will happen, we are more every day and I think we will achieve it in the end,” Elias Houariz, a 22-year-old baker, told AFP at the rally.
Manchester City's Catalan manager Pep Guardiola dedicated his team's 2-1 win over Napoli in the Champions League on Tuesday to the detained pair.
“We have shown in Catalonia that citizenship is bigger than any ideas. We hope they will be released soon,” he said.
Thousands of workers in Barcelona and other cities also staged a brief walkout at noon in protest at the detentions.
The demonstration came as the clock ticks down to Thursday, the deadline Madrid has set for Catalonia's separatist leader Carles Puigdemont to spell out whether or not he intends to declare independence outright following the banned October 1 referendum.
Puigdemont has so far declined to give a definitive response, calling instead for Spain's Prime Minister Mariano Rajoy to come to the negotiating table.
But Rajoy rejects mediation as a non-starter and unless Puigdemont backs down, appears likely to start imposing direct control over the semi-autonomous region.
Doing so could further escalate Spain's worst political crisis since it emerged from military dictatorship in 1977.
The referendum, marred by a police crackdown on voters, resulted in a 90-percent “Yes” vote. But turnout was only 43 percent as many supporters of Spanish unity stayed away after the Constitutional Court ruled the vote illegal.
With the two sides stuck in a stalemate, Madrid announced Monday that it was cutting its economic growth forecast for next year from 2.6 to 2.3 percent.
The prolonged uncertainty has rattled stock markets, while nearly 700 companies have moved their legal headquarters out of Catalonia, according to official figures.
The Spanish league have delayed putting out to tender their international television rights amid uncertainty over what the Catalonia crisis could mean for Barcelona, La Liga president Javier Tebas said on Tuesday.
“This is a problem that could greatly affect the value of our competitions,” he said.
People holding placards reading 'Help Catalonia' and 'Freedom' in Barcelona. Photo: Pau Barrena/AFP
The pair nicknamed the “two Jordis” are the leaders of pro-independence citizens' groups Omnium Cultural and the Catalan National Assembly (ANC).
The groups count tens of thousands of members each and have emerged as influential players in the crisis.
“We are entering in a new phase of mobilisations, and they will be peaceful as always,” said Omnium spokesman Marcel Mauri.
Police officers were trapped for hours and their vehicles vandalised as protesters ringed the building, with the pair standing on a police car calling for “permanent mobilisation” against the Spanish state.
The crime of sedition can carry up to 15 years in prison.
At the evening rally, Maria Miracle, 77, complained that “the corrupt remain free and people who organise civilised, peaceful protests are jailed.”
She understands Spanish but insisted on speaking to AFP in Catalan, remembering the times during Francisco Franco's dictatorship when the regional language was officially banned and she “had to pay one peseta for every word of Catalan spoken at school.”
With its own language and culture, Catalonia is proud of its autonomy but its 7.5 million people are split over whether to break away completely from the rest of Spain.
Supporters of independence say the region pays more into Spanish coffers than it gets back and could prosper by going it alone, but their opponents say secession would spell political and economic disaster.