Police said officers in riot gear charged against a crowd of students outside the stock market in Spain's second largest city in the country's northeast and made an unspecified number of arrests. They had broken away from a larger rally of thousands of striking students.
The fire set to the containers spread to a car and protesters smashed a bank window.
Some later made their way toward the University of Barcelona and took refuge in a plaza inside the campus.
The protests started peacefully as part of a nationwide day of rallies called to protest cuts in education spending as Spain endures austerity and the prospect of recession.