Thousands of far-right demonstrators gathered outside the headquarters of Spanish Prime Minister Pedro Sanchez on Tuesday in a tense protest against his proposed law granting amnesty to Catalan separatists.
Sanchez's highly controversial bill seeks to grant amnesty to Catalans being prosecuted over for their involvement in the failed attempt to secede from the rest of Spain in 2017.
The legislation would enable the outgoing prime minister to obtain the support of pro-independence party lawmakers, essential for forming a government.
Nearly 7,000 demonstrators gathered Tuesday, according to authorities, carrying placards emblazoned with the words "no to amnesty" and "Spain does not pay traitors", TV images showed.
Some protesters were dispersed by police charges and tear gas.
Thirty-nine people were slightly injured, including 29 police officers, Madrid's emergency services told AFP, while six people were arrested for disturbing the peace, according to a provisional report from local authorities.
Others had earlier tried to reach parliament, which was barricaded by the police, who deployed a large force and a helicopter in the centre of the capital Madrid, local media reported.
The demonstration was called by several far-right groups and supported by the far-right Vox party, which was represented at the event by the leader of its parliamentary group, Pepa Millan, who told the crowd that her party had come to demonstrate "peacefully".
On Monday evening, several thousand demonstrators had gathered outside the headquarters of the Spanish Socialist Workers' Party (PSOE) in Madrid, Barcelona and Valencia.
In the capital, the police had also dispersed some of the 3,800 demonstrators using force and tear gas.
Sanchez's team has said he was confident of delivering on the deal with the Catalan parties.
In a message on X, formerly Twitter, Sanchez on Monday criticised "harassment" by the protesters whose behaviour was akin to "attacking democracy", he said.
The leader of the far-right Vox party, Santiago Abascal, slammed the use of tear gas.