Authorities said that the accident had occurred on Friday near the southern city of Osmaniye.
Governor Zubeyir Kemelek said the overall death toll was 42, including the Turkish driver and another Turk who was traveling in the cabin of the truck.
Dozens of bodies were seen in television footage lying on the asphalt just behind the trucks.
The driver of the transport truck said he had to park on roadside after his truck developed an engine problem.
The Anatolia news agency citing witnesses reported that the impact of the crash ejected the immigrants onto the asphalt.
The immigrants were standing during their journey in the back of the truck.
Doctors said that most of the victims died of brain trauma or internal bleeding.
The immigrants had entered Turkey from Iran and were planning to sneak into Bulgaria and then to Greece, Anatolia said.
Turkey is a major transit point for thousands of Middle Eastern and African migrants attempting to reach Europe illegally every year.