Police and protesters fought in the streets of Barcelona on Wednesday as more than 30,000 people joined students in demonstrations against cuts in education spending.

Fires were lit in the streets, cars burned and bank windows smashed with missiles as the protests turned violent. At least one bank was broken into and police fired rubber bullets as roads in the city were blocked.

Baton-wielding riot police made several charges, pushing hundreds of demonstrators back into the main buildings of the University of Barcelona, not far from the central Plaça de Catalunya.

A small group of peaceful demonstrators marched on the Mobile World Congress – a major international telecoms trade fair – being held at the city's exhibition centre, blocking a nearby main road.

Masked protesters also attacked a television cameraman as authorities suggested the student protests had been infiltrated by troublemakers. "This gives an image of students and the university world that is simply not real," said Antoni Castellà, the director of universities for the Catalan regional government.

Early reports were of a handful of arrests and nine injuries.

"We did not expect this degree of repression," said Pau Brosons, a student, after police hit protesters with truncheons. "Nobody broke anything until they charged."

Students were due to assemble again on Wednesday night to decide whether to continue their protests.

More peaceful demonstrations were held in several Spanish cities, with students and schoolchildren to the fore. Many came out in support of their counterparts in Valencia after heavy policing of recent demonstrations there added fuel to the protest movement.

The growing unrest comes as prime minister Mariano Rajoy tries to persuade the European commission to relent on a deficit target that would see Spain asked to adjust its budget by some €45bn (£37bn) this year.

"We will bring the deficit down as much as we can," said Rajoy, in the first suggestion that Spain believed it would be unable to reduce the deficit to the 4.4% of GDP currently expected.

Officials in Brussels said they first wanted to know exactly why Spain's deficit, which was meant to be 6% of GDP in 2011, had come out at 8.5%. The government has pinned the blame on regional administrations, which are in charge of providing education and health services across the country.

Unions are reportedly planning a general strike, scheduled for 29 March, to protest against reforms to Spain's labour laws. The country's economy is already falling back into recession as austerity measures take effect. Unemployment is at 23% and rising.

"I ask Spaniards to understand that things are not easy, that we will have to make an effort, but that I am sure we will get out of this situation," said Rajoy.