(CNN) -- A cargo train with stowaway migrants on board derailed in southern Mexico on Sunday morning, killing five people and injuring 17 more, officials said.
At least 250 Honduran migrants were traveling on the train when it derailed, the government of Mexico's Tabasco state said in a statement.
Rescuers were at the scene in a remote area of the state on Sunday, civil protection officials said.
Photos showed overturned train cars and injured victims on the tracks.
Eight cars overturned in the derailment, which happened around 3 a.m. in the municipality of Huimanguillo.
The train's engine and first car stayed on the tracks, allowing authorities to use them to transport injured victims to a regional hospital, officials said.
The locomotive derailed after heavy rains in the area softened the earth around the tracks, state officials said.
In addition to the hundreds of stowaway migrants aboard, CNN affiliate FOROtv reported the train was carrying scrap metal.
Mexico no longer has a nationwide passenger rail system, but thousands of Central American migrants hitch rides on freight trains heading north toward the United States.
On the train, nicknamed "The Beast" and "the train of death," they often huddle on rooftops and cram into spare spaces between cars.
All of those who died or were hospitalized after Sunday's derailment are Honduran, officials said.
El Salvador's foreign ministry said consular officials were heading to the area to help any Salvadorans who may have been injured.
Mexican Foreign Minister Jose Antonio Meade said in a Twitter post that officials are communicating with authorities in Central America over the derailment and offering assistance to injured victims.
Representatives from the private railway company that operates the cargo train route could not be immediately reached for comment.