The National Transportation Safety Board said it’s trying to determine why a switch was locked in a position that sent an Amtrak train off the main line ​to a side track ​where it rammed a parked CSX freight train​ early Sunday​, killing two and injuring more than 100.

​NTSB Chairman Robert Sumwalt said a key to figuring out what caused the deadly crash is determining why the Silver Star was diverted to another line by a padlocked switch — a common practice known as “lined and locked.”

As the freight train traveled over the main track the switch was activated to allow it to move to the side track. It wasn’t moved back.

“Of course, key to his 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,” he ​said during a briefing Sunday afternoon.

Investigators found the switch still padlocked Sunday morning, Sumwalt said.

H​e also said that NTSB investigators didn’t know if signals further up the line indicated the track had been switched. ​

I​nstead of staying on the main line, the Silver Star en route to Miami from New York City slammed into the rear of the stationary CSX train while going the speed limit of 59 mph.

The Amtrak train was carrying 139 passengers and eight crew members ​when the crash occurred at 2:35 a.m. in Cayce, S.C. ​