Border Patrol agents in New Mexico received a frantic 911 call from an illegal immigrant who was injured and trapped on top of a moving train.

Agents quickly responded to the distress call and found a man trapped on top of a train car early Thursday morning last week. The man was making hand gestures to get the agent’s attention. The agents worked quickly to contact the train’s engineer and get him to stop, according to U.S. Customs and Border Protection officials.

The engineer made an emergency stop where agents would be able to access the train car where the injured migrant was trapped, officials said.

Agents managed to asses the illegal immigrant’s condition and help him down from the top of the rail car.

The agents said the man appeared to be in a lot of pain. An evaluation at the scene revealed he injured his ankle and ribs while attempting to board the moving train, officials stated.

Following a medical assessment on the scene, Border Patrol agents treated the 34-year-old migrant for a broken ankle.

An ambulance arrived and transported the Mexican national to a regional hospital in Alamogordo, New Mexico. Doctors at the hospital treated the broken ankle and examined the man’s ribs. After treatment, doctors released the migrant to the custody of the Border Patrol agents.

During a background investigation, the migrant confessed that he illegally entered the U.S. in Texas in the El Paso-Juárez Metropolitan Border Area on June 20, officials stated. His arrest occurred the following day in New Mexico.

El Paso Sector agents rescued 26 illegal immigrants in distress during Fiscal Year 2018. So far, they have not witnessed any deaths associated with human smuggling in the sector, officials reported.

Bob Price serves as associate editor and senior political news contributor for Breitbart Texas. He is a founding member of the Breitbart Texas team. Follow him on Twitter @BobPriceBBTXGAB, and Facebook.