Brandishing their maces, the mayors sang "Els Segadors," the official hymn of the northeastern region, whose separatist executive is preparing to hold a referendum on October 1 in defiance of Madrid.
More than two-thirds of Catalonia's 948 mayors have pledged to open municipal premises for the vote, prompting Spain's public prosecutor to order a criminal probe and threaten them with arrest if they do not comply.
"I'm not protesting in support of independence but in support of voting," said Josep Sole, the 74-year-old mayor of La Maso, a small 300-strong village in southern Catalonia.
But in a region sharply divided over whether it wants independence, many big, populated cities have refused to cooperate for the vote. And all eyes are on the biggest of them all -- Barcelona.
Mayor Ada Colau supports a referendum, but she will not be directly involved. She has said she reached a deal with the regional government so residents will be able to vote "without putting institutions or public workers at risk." Neither her nor Catalan President Carles Puigdemont, however, have revealed what the deal entails.
Puigdemont was also at the protest where others came to pledge their support, many waving yellow, red and blue separatist flags.
"Don't underestimate the strength of Catalonia's people who have taken the decision to decide," he said.
Catalonia is sharply divided over the issue. A poll in July commissioned by the regional government found that 49.4 percent of Catalans were against independence while 41.1 percent were in favour. But more than 70 percent wanted a referendum to settle the matter.
Colau, meanwhile, expressed her "solidarity" with the mayors by welcoming them at city hall.
"It's shameful: a state incapable of listening to the people of Catalonia," she said.