The state-owned rail company, Renfe, said 40 people were injured but most were treated and released. At least eight required hospitalization.
The Tuesday evening crash happened when a passenger train with about 90 people on board collided with a freight train near Chinchilla in Albacete province, 155 miles southeast of Madrid.
The cause of the crash may have been a railway worker who gave a wrong signal, Development Minister Francisco Alvarez Cascos said. Normally, one of the trains would have been diverted to a side track while the other continued on the line.
The locomotive and first few cars of the passenger train caught fire after the crash and TV footage showed flaming cars piled on the tracks. The freight train was not carrying cargo.
``I saved myself because I was in the toilet at the moment of the collision,'' passenger Nieves Pinto said on National Radio. ``I reeled from side to side. When I tried to get out to find my husband there was a tremendous fire, everybody was screaming.''
The Castilla-La Mancha regional emergency rescue service renewed the search for the missing after dawn Wednesday.
Three large cranes were on either side of the railway line where smoke was still rising from the charred cars. TV footage showed rescue workers and forensic investigators searching amid the blackened wreckage.
Prime Minister Jose Maria Aznar visited the accident site, greeting rescue workers and discussing the accident with officials.
Both locomotive crews died when the trains collided three miles from Chinchilla and nine miles from Albacete underneath high tension wires that fell on the wreck. Other victims included a mechanic, said a spokesman of Spain's state rail way company Renfe.
``I saw horrible scenes,'' Juan Carlos Garcia Morate, who saw the accident from his home and was one of the first to arrive at the scene, told Radio Cadena Ser.
``I saw people in the cafeteria holding their burnt hands out of the window and screaming help me, help me, and I couldn't get close to them ... I can't forget that image,'' he said.
After the accident, police warned people in Chinchilla to stay indoors and close their windows, believing the freight train was carrying sulfuric acid. But hours later Renfe confirmed the tanker cars were empty at the time of the crash.
In January, an intercity train derailed on the same line from Madrid to Cartagena, also near Albacete, killing two people.