At least two passengers were pulled alive from the crumpled wreckage as the rescue operation took place in the scorching heat.
Giuseppe Corrado, vice president of the province of Andria, told Sky TG24 the death toll stood at 20 and that rescue operations were continuing. Another official stressed the final toll would not be known until the wreckage had been pulled apart.
The two trains, each with four cars, collided head-on at midday in an olive grove on flat terrain between the towns of Andria and Corato on a line with just a single track.
"It's a disaster as if an airplane fell," local Mayor Massimo Mazzilli said on his Facebook page, where he posted photos of the crash.
Italian Premier Matteo Renzi pledged a thorough investigation and returned to Rome from Milan to monitor the situation.
Riccardo Zingaro, the chief of the local police in Andria, told Sky it was "a great tragedy." Some rescue workers seemed overwhelmed by the scene and the heat.
A still photo of the crash showed cars crumpled together like an accordion and forced off the tracks at sharp angles.
"The impact was significant, and we are now verifying the consequences," said Giovanni De Siervo of Italy's civil protection service.
A field hospital was set up in the nearby fields to treat the numerous injured, who were also being transported to hospitals.
"Some of the cars are completely crumpled and the rescuers are extracting people from the metal, many of them injured," Zingaro told ANSA at the scene.
Italy's premier, Renzi, said the train crash "is a moment of tears" and pledged not to stop investigating until a cause was determined.
