Politicians in Catalonia have used police helicopters to get to the regional parliament to avoid about 2,000 demonstrators who are trying to blockade the building in protest against planned budget cuts in education and health.
A police spokeswoman said the situation was tense as the deputies arrived at Ciutadella park in central Barcelona, where the parliament is located. The Catalan president, Artur Mas, was among at least 10 politicians who arrived by helicopter.
Scuffles broke out as police pushed protesters back so the deputies who arrived on foot could get in.
The politicians had been heckled, and at least two sprayed with paint, the spokeswoman said. She said there were no immediate reports of injuries, but unnamed medical sources told Spanish daily el Pais that 23 people were treated for injuries.
Some 400 police packed Ciutadella park to ensure protesters could not enter by climbing over the railings. Riot police vans guarded the main park entrance.
"I think it is important to be here protesting against the spending cuts, because to cut social spending with the excuse of the crisis is a big farce," said one protester, Mariela Pita.
After the politicians entered the parliament, hundreds of protesters left the area but they were expected to return later in the day, when the politicians leave the building.
The demonstration was part of nationwide protests over the past month by young and unemployed people angry at Spain's handling of the economic crisis. The highlight of the movement was a near-month-long, round-the-clock makeshift protest camp in Madrid's Puerta del Sol square. The vast majority of the protests have been peaceful.
Politicians across Spain criticised the Barcelona protest.
"Aggressions and insults against politicians are aggressions and insults against the people's representatives," said Ramon Jauregui, spokesman for the Spanish central government.
"I can accept the protest by 2,000 people but I would remind those 2,000 people that 3.2 million people voted for those deputies that were haarassed," he said.
But Gaspar Llamazares of the United Left coalition said the protests represented a "social fracture" in Spain, where the economic crisis has left close to 5 million people unemployed.
Last week, hundreds of protesters gathered outside the national parliament in Madrid to demonstrate against labour reforms.