The organizers claimed 80,000 participated in Barcelona, but the Guàrdia Urbana municipal police force estimates a more modest 16,000.
The demonstration in Catalonia's biggest city started at Plaça de la Universitat near La Rambla at midday, before continuing down the Gran Via avenue to Plaça d’Espanya, then on to Plaça dels Països Catalans in front of the busy Sants railway station.
The protest takes place in the middle of a general strike first declared by student organization Universities for the Republic (Universitats per la República) then joined by the Catalan Student Syndicate (Sindicat d’Estudiants), in which students have been told not to go to university classes on the 28th and 29th of September or high school classes on the 27th and 28th in defence of the planned referendum.
"The majority of young people are separatists, and if they weren't, they have become separatist after seeing what Spain has done in recent weeks," 16-year-old high school student Aina Gomez told AFP.
Opinion polls show Catalans are divided on the issue of independence but a majority want to vote in a legitimate referendum on the matter.
Smaller student protests have also taken place elsewhere, with more than 2,000 demonstrating in northern city Girona, and around 1,000 in Tarragona in the south.
Manifestació d'estudiants en favor del referèndum a Tarragona pic.twitter.com/KlAnvGzsG2— Tarragona Ràdio (@tarragonaradio) September 28, 2017
In Barcelona, the protesters were joined by some of the city's firefighters, who earlier on Thursday held a demonstration of their own, unveiling a giant banner with the phrase "Love Demoracy" and a ballot box printed on it at the Museum of Catalan History.
Some students have said they may occupy schools and universities that could be used as polling stations in Sunday’s referendum, after Spanish prosecutors on Tuesday ordered police to seal off places set to be used for the vote then guard them until Sunday.
Catalonia's Mossos d'Esquadra police force has warned there is a risk of disrupting public order if stations are closed off as they have been instructed to do.
Police have also seized close to ten million ballot papers and other items destined for the vote, but a video published on Thursday and shared by Catalan President Carles Puigdemont showed hundreds of new ballot papers being printed at a secret location.