Separatists outraged at the police rally also turned out, with city authorities estimating that around 3,000 people took part in the police demo and 6,000 in the counter rally.
Skirmishes took place between the two sets of demonstrators while police also charged at separatists several times after they tried to cross a security cordon and threw paint and other objects.
Six people were arrested, Catalan police said, while 24 demonstrators were injured, according to medical services.
“Of course we want to support our colleagues who carried out their duty last year, to defend the law,” Daniel, a 31-year-old policeman from the Balearic islands told AFP.
“The protest is to assert our rights and we are doing it in Barcelona because it is a big European city…. We did not come here to provoke,” he added.
The national police and the civil guard, which are funded by central government, are calling for their pay to be brought into line with police in Catalonia and the Basque country who receive a supplement from their regional governments.
The Catalan government, then led by Carles Puigdemont, on October 1, 2017, held a referendum on independence for the region deemed illegal by the Spanish courts. The referendum, according to the regional executive, resulted in a 90 percent 'Yes' vote.