Kroonstad: A passenger train smashed into a truck at a level crossing in South Africa on Thursday, killing at least 18 people, injuring 254 and throwing several carriages off the rails.

Flames ripped through the twisted wreckage and choking black smoke rose into the air as desperate passengers clambered out of the train travelling from Port Elizabeth to Johannesburg to escape the inferno.

Tiaan Esterhuizen, who was travelling on the train as he returned from holiday, attempted to rescue three women who were trapped in a burning passenger wagon.

Emergency workers and ruined carriages at the scene of a train accident near Kroonstad, South Africa on Thursday. AP

"I saw around 12 cars on their side and one was already burning. We heard some women screaming when we came closer‚ so a few of us climbed over the cars," he told the Times LIVE news site.

"Two of the women were sort of on top of each other. Another was further back. Her legs were trapped. One of the women was shouting that there was a baby inside also.

"We searched but could not find the child... I am quite sure those women burned to death."

Truck driver blamed

Rescuers rushed to the scene to search for survivors and treat the injured. Officials warned the toll could rise as operations continued to clear the crash site.

"Police are investigating. The truck driver was taking chances... that cost lots of lives," Transport Minister Joe Maswanganyi told reporters at the scene.

"The truck driver has been taken to hospital where we are going to do a blood test to verify if he was sober or not, or what was the problem."

The Shosholoza Meyl rail company, which operates long-distance trains in South Africa, said the train collided with the truck at about 09:00 am (07:00 local time).

It said the truck had made an "untimely" crossing of the tracks when it was hit by a train at high speed, between the towns of Hennenman and Kroonstad, 200 kilometres southwest of Johannesburg.

One of the derailed carriages was the power generator behind the locomotive car. It caught fire and the flames spread rapidly.

Shosholoza Meyl said there were 429 passengers on board.

Mthuthuzeli Swartz, the acting chief executive of the Passenger Rail Agency of South Africa's rail division confirmed that 18 people had been killed and 254 injured, adding that it would be "tragic and unexpected" for the death toll to increase further.

"The pathologists who are here have given us the assurance they are convinced that the number of dead, 18, will be the final number," he told AFP adding that only 88 crash survivors remained in hospital.

Maswanganyi said in a statement that an investigation to determine the circumstances of the crash had been launched.

Holiday travellers

Some victims were treated on a strip of grass beside the railway line while others were taken to the hospital. Uninjured passengers waited on a nearby road, some of them carrying their luggage.

The New Year is a busy period for transport in South Africa, with railways and roads carrying travellers returning to work after the holidays.

In 2015, 15 people were killed in eastern South Africa when a mini-bus taxi fell from a bridge onto railway tracks and was hit by a train.

In 2016-17, 495 people were killed on the country's railways according to the Railway Safety Regulator — an increase of 8 percent on the previous year.