CIMARRON, Kan. - An engineer noticed a significant bend in a rail and applied the emergency brakes before a passenger train derailed in western Kansas early Monday, an official said.

The Amtrak train apparently was travelling at about 75 mph when the engineer noticed the deformity in the rail and pulled the brakes, a U.S. official told The Associated Press. The official spoke on the condition of anonymity because the official wasn't authorized to speak publicly about the federal investigation.

The train carrying 131 passengers and 14 crew was travelling 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.

Get Breaking News Delivered to Your Inbox

Thirty-two people were taken to hospitals for treatment, and 29 of them had been released by late morning, Amtrak said. Ashley Rogers, a spokeswoman for Grey County, said none of the injuries were life-threatening. It wasn't known if any crew members were among the injured.

Daniel Aiken, 21, of Lenexa, Kansas, said he heard screaming as he climbed out of their 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," he said, "they calmed down."

Passenger Daniel Szczerba described the chaos for CBS affiliate KWCH.

"All the lights went out, it was dark," Szczerba said. "People traveling in groups (of) four or five got thrown around the car as it turned over and lost people as they were trying to get out of the emergency exits."

Amtrak didn't say how fast the train was traveling when it derailed, and it didn't immediately respond to calls seeking further details. It was foggy in the area at the time, but it wasn't immediately known if that played any role.

Andy Williams, a spokesman for BNSF Railway, which owns the track, referred questions to Amtrak. He said he say when the track was last inspected while the investigation is ongoing. Amtrak said it is working with BNSF on the investigation.

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

Kelsey Wilson, 21, 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.

Keith Holloway, a spokesman for the National Transportation Safety Board, said in an email that the agency was sending a team to investigate. He said more information would be released once the team arrived in Kansas.

Daniel Szczerba provided these photos to CBS News:

Two of five Amtrak train cars that derailed west of Dodge City, Kansas early on March 14, 2016 are seen in photo provided to CBS News by a passenger DANIEL SCZCERBA