The students, who were on a European exchange programme in the northeastern region of Catalonia, came from 16 different countries including Britain, the Netherlands, Ukraine, Norway, Finland, Switzerland and Sweden but also Japan and New Zealand.
All the dead were female, according to a regional government source who requested anonymity, but authorities have yet to announce their exact nationalities.
The accident occurred just before 6 am local time near the small town of Freginals, about 150 kilometres south of Barcelona, as the students were returning from the Fallas festival in eastern Valencia known for the burning of giant statues.
The bus then hit a car coming in the opposite direction, injuring two people inside, he added.
More From This Section
Interior Minister Jorge Fernandez Diaz, who rushed to the scene, said it was still not clear why the driver hit the railing in the first place, adding however that the accident was likely due to a "human factor".
An AFP photographer at the scene several hours after the crash said many fire engines were at the scene, as were three hearses and a heavy-lift crane.
Spain's national radio station RNE spoke to the son of the owner of the company that chartered the bus, who said his father was driving another bus in front of the one that crashed -- one of a total of five vehicles ferrying students back from Valencia.
"All of a sudden, he stopped seeing it in his rear-view mirror. He stopped at the next service area, called the driver but he didn't pick up," said the son, named only as Raul.
"The driver is in a state of shock, but he's okay physically," he added.