Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An Amtrak train traveling from New York to Miami collided with a CSX freight train early Sunday in South Carolina, killing two Amtrak personnel and injuring more than 100 others, authorities said.

The crash overnight caused the lead engine and some passenger cars to derail, Amtrak said in a statement. There were 136 passengers and nine crew members aboard the Amtrak train when it collided with the freight at around 2:35 a.m. near Cayce in Lexington County, officials said.

Hospitals treated 116 people in total, with injuries ranging from very minor to more serious, South Carolina Gov. Henry McMaster said during a news conference.

The engineer of the Amtrak train, Michael Kempf, 54, of Savannah, Georgia, and the conductor, Michael Cella, 36, of Orange Park, Florida, were killed, Lexington County Coroner Margaret Fisher said.

A friend of Cella’s, Michael Callanan, told NBC affiliate WIS of Columbia that the conductor had two young children and had recently purchased a home.

“When he got done with work, he put his stuff in his bag and went home,” said Callanan, a former conductor who met Cella in 2008 while working for Amtrak in Jacksonville.

On his Facebook profile, which was confirmed by a relative to NBC News, Kempf posted often about politics and military veterans. He also wrote to his wife, “my Best Friend, Soul Mate and at last, my Lovely Wife Thank You for your support and putting up with Me.”

Authorities investigate the scene of a fatal Amtrak train crash in Cayce, South Carolina on Feb. 4, 2018. Tim Dominick / The State via AP

Robert Sumwalt, chairman of the National Transportation Safety Board, or NTSB, said that the Amtrak train was diverted from the main track, where it was supposed to have been, onto a side track where the CSX freight train was. The freight train had been at a loading and unloading facility for automobiles before being parked on the side track, he said.

Sumwalt said a rail switch that changes the direction of the track was lined in a way that diverted the Amtrak train from the main line onto the side track.

"For whatever reason, that switch was, as they say in the railroad industry, 'lined and locked,' which means it was aligned for the train coming down this way to be diverted into the siding," he said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"Of course, key to this investigation is learning why that switch was lined that way, because the expectation, of course, is that the Amtrak would be cleared and operating straight down like this," he added, pointing to a whiteboard drawing of the tracks.

The CSX train was stationary and appeared to be empty at the time of the crash, officials said. McMaster said there were several train tracks at the location of the collision.

The NTSB sent an investigative team, and Amtrak and CSX said in statements that they were fully cooperating with the safety board.

Amtrak said that CSX maintains all of the tracks and signal systems in the area.

Richard Anderson, Amtrak's president and chief executive, said in a phone call with reporters that "our understanding is that the signal system was down and that we were being managed by the dispatchers and by CSX controlling the switches on this bypass."

Anderson added that the Amtrak train was supposed to be on the main line "just east of the collision."

CSX did not provide details about the collision. In a statement, the company said it was focused on assisting victims and working with NTSB investigators.

The statement added that the company “hosts more passenger trains on its network than any other major railroad in the United States, and passenger rail remains one of the safest ways to travel.”

The collision was yet another crash highlighting Positive Train Control, a system that among other things is designed to prevent trains from speeding.

"A fully operational Positive Train Control system could've avoided this accident — that’s what it's designed to do," Sumwalt said Sunday afternoon.

An Amtrak train, bottom right, and a CSX freight train, top left, crashed in Cayce, South Carolina on Feb. 4, 2018. Jeff Blake / AP

Dr. Steve Shelton, director for emergency preparedness at Palmetto Health System, said that it received 62 patients across its three facilities.

Shelton added that the "majority" of patients did not sustain life-threatening injuries. Hospital officials said later Sunday that six patients had been admitted.

Lexington Medical Center said it received 27 patients, most with minor injuries. Many were treated for cuts and bruises and were released, while two were admitted, spokeswoman Jennifer Wilson said.

Jaclyn Kinney, 22, from of Pinehurst, North Carolina, was in the sleeper car with her boyfriend on their way to Orlando.

"We basically woke up to the train crash," she told NBC News.

"It knocked us around, and we got bumped into the wall from the impact, and the train derailed. The cafe car that was right in front of us was in much worse shape, so we were lucky," she said.

"The staff members came by and made sure people were OK before we left the car. We were waiting for a few minutes before they evacuated us."

"There were a few people with noticeably bad injuries, but most people didn't seem super injured," Kinney added.

President Donald Trump tweeted that his "thoughts and prayers are with all of the victims involved in this mornings train collision in South Carolina" and thanked first responders.

My thoughts and prayers are with all of the victims involved in this mornings train collision in South Carolina. Thank you to our incredible First Responders for the work they’ve done! — Donald J. Trump (@realDonaldTrump) February 4, 2018

South Carolina's Emergency Management Division said 5,000 gallons of fuel was spilled in the crash, with hazmat crews responding to the scene. Officials said there was no further threat to the public.

It was the second major Amtrak incident in less than a week. On Wednesday, a train carrying Republican members of Congress to a retreat in West Virginia collided with a garbage truck. One person on the truck was killed.