CIMARRON, Kan. (AP)  An Amtrak train carrying more than 140 people derailed in rural Kansas early Monday, moments after an engineer noticed a significant bend in a rail and applied the emergency brakes, authorities said.

At least 32 people were hurt, two of them critically, authorities said.

A federal transportation official said the investigation would focus on the condition of the rails. Local authorities said they were checking whether a vehicle crash may have damaged the track before the accident.

The engineer of the train known as the Southwest Chief noticed the deformity in the rail and pulled the brakes, said Earl Weener of the National Transportation Safety Board. He put the train”s speed at the normal limit of 60 mph.

Weener said there was some initial indication of a “misalignment” on the rail. But it was unclear what that was or what caused it. He said the engineer was vigilant and noticed the variation on the track, causing him to brake.

Federal officials also planned to review recorded data from the train.

The train, which had 131 passengers and 14 crew members, was making a 43-hour journey from Los Angeles to Chicago when it derailed shortly after midnight along a straight stretch of tracks in flat farmland near Cimarron, a small community about 160 miles west of Wichita. Eight cars derailed, and four of them ended up on their sides.

Thirty-two people were taken to hospitals for treatment. Four of them remained hospitalized Monday evening, including two people who were airlifted to Amarillo, Texas. The rest had been released.

The tracks run along Highway 50, which has no barrier that would prevent a vehicle from leaving the roadway and driving near or onto the tracks. The road and tracks are separated by a shallow depression.

Authorities were examining tire tracks leading to the rails. The damage did not appear to be intentional, Gray County sheriff”s Deputy J.G. Sharp said.

The track was inspected last week, Weener said.

Daniel Aiken, of Lenexa, Kansas, said he heard screaming as he climbed out of an overturned car. He stopped to smell a fluid that was flowing through the car, fearful that it was fuel, but was reassured when he realized it was water.

“Once people realized the train wasn”t going to blow up, they calmed down,” he said.

Timothy Davidson, from Nashville, Tennessee, said he and several other passengers heard what he called “a lot of clacking for about 20 minutes” before the accident.

“The train didn”t sound right,” he said.

Derek Kemp, who is moving back to Kansas City, Missouri, from California, said he was in a bathroom when he felt the train suddenly tilt, sending him face-first into the bathroom door and across a hallway into a baggage area.

Kemp, who has fire and rescue training, quickly scrambled to help women and children off the train.

Dave Gibbs, a Colorado man who was headed to Lawrence, Kansas, for a possible chef”s job, said that the train “started rattling back and forth, and you could tell it was off the tracks.”

That shaking lasted five to seven seconds, he said, before the train began tipping, then coming to an abrupt stop that sent a woman tumbling onto him.

“I was waiting for the worst. I was afraid I was going to die,” recalled David Tisdale, who was New York-bound from his Arizona home.

Amtrak did not immediately respond to calls seeking details. Visibility at the accident site was relatively clear at the time of the derailment.

Andy Williams, a spokesman for BNSF Railway, which owns the track, said the derailment was not caused by poorly maintained track. He said the track is inspected twice a week and meets Federal Railroad Administration guidelines.

Uninjured passengers were taken to the Cimarron community center to wait for Amtrak to make arrangements to transport them to their destinations.

Kelsey Wilson said she woke up when she felt the ride “getting really bumpy” and the train started to shake. Wilson, who was returning to Truman State University in Kirksville, Missouri, after spending spring break at home in Pueblo, Colorado, said her car disconnected from the one in front and that she hit her head as it overturned.

Wilson said she escaped through the top of the flipped car then slid down the side before she “passed out.” She was taken to a hospital and released with a neck brace.

The future of the Southwest Chief service  the only Amtrak route through Kansas, with stops at six cities  had been uncertain in recent years.

Amtrak had warned it might stop or reroute the line because of disputes over who would pay to install safety technology, but officials reached a deal last year.

Taxpayers have thrown in tens of millions of dollars to improving parts of the rail line in Colorado and Kansas.

___

This story has been altered to correct the name of the company that owns the tracks to BNSF Railway, instead of Burlington Northern Santa Fe.