A bus carrying university exchange students back from Spain's largest fireworks festival crashed on Monday on a main highway in the northeast, killing at least 13 passengers and injuring 34 others, officials said.

The passengers included Spaniards and foreign nationals from around 20 countries, authorities said.

The bus, which was carrying 57 passengers, appeared to have hit a guardrail of the AP7 highway before cartwheeling across the road, slamming through a divider and landing on its side, said Jordi Jane, spokesman for Spain's northeastern Catalonia province.

The students, part of the Erasmus exchange programme, had travelled to the eastern city of Valencia to take part in the renowned Fallas fireworks festival and were returning when the bus crashed, Jane said. Most were studying at two universities in Barcelona.

The crash took place near Freginals, halfway between Valencia and Barcelona.

Initially, Jane said 14 had died in the crash, but Spanish Interior Minister Jorge Fernandez Diaz later confirmed the death toll was 13. He said 28 passengers received medical treatment in local hospitals and others received first aid at the crash site.

The regional government of Catalonia said in a statement in the early evening that "according to the latest data, the ill-fated bus had students from Hungary, Germany, Sweden, Norway, Switzerland, Czech Republic, United Kingdom, Italy, Peru, Bulgaria, Poland, Ireland, Japan, Ukraine, Holland, Belgium, France, Palestine, Turkey, Greece." It added that two countries, New Zealand and Finland, were still pending confirmation.

The statement said autopsies had been completed on nine of the 13 dead and a judge would release the bodies to families once full identification was complete in all cases.

Poland's Foreign Ministry said one Polish man was hospitalised after the bus crash and Swiss authorities said one young Swiss woman was injured, but had been discharged from a hospital.

The bus that crashed was one of five that had travelled to the festival with students from Barcelona, the Catalan government said in a statement.

Television images from state broadcaster TVE showed the bus also crashed into an oncoming car on the opposite side of the highway. The passengers in the car were injured, the Catalan government said.

The bus driver was being held at a police station in the city of Tortosa, Jane said. Road conditions were good at the time of the crash and investigators were looking into the cause of the tragedy, he said.

Fernandez Diaz said the driver passed alcohol and drug tests he was given.