Following a third fatal Amtrak crash in recent months, the railroad's boss said Sunday that freight railroad CSX was responsible for Sunday's collision in South Carolina that left two dead and scores injured.

Amtrak President and Chief Executive Richard Anderson said CSX was responsible for the tracks and signals in the area south of Columbia, S.C., including one switch that diverted the Amtrak train onto an occupied track, Reuters reported.

“CSX had lined and padlocked the switch off the mainline to the siding, causing the collision,” Anderson said in a statement.

CSX did not address Anderson's comments, but said it was working with federal investigators, the report said, adding that both Amtrak and CSX offered condolences to the families of the two Amtrak employees who died.

Engineer Michael Kempf, 54, of Savannah, Ga., and conductor Michael Cella, 36, of Orange Park, Fla., were killed, Lexington County, S.C., Coroner Margaret Fisher said.

President Donald Trump also sent condolences.

"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!" the president tweeted Sunday.

Anderson also pointed his finger at the federal government, saying it needs to ensure that a high-tech safety system that railroads have been urged to install for years is finally in place by the end of 2018.

He deferred to investigators about whether the system, called Positive Train Control, would have stopped Sunday's crash.

"Theoretically, an operative PTC system would include switches in addition to signals, so it would cover both speed and switches," Anderson said.

The South Carolina crash followed at least two other recent deadly Amtrak crashes: One in Washington state in December that killed three people, and one in Virginia in January that killed one person.

Meanwhile, the nation's transportation safety chief agreed Sunday that the South Carolina crash and others could have been prevented if Positive Train Control had been implemented on time.

Robert Sumwalt, chairman of the National Transportation Safety Board, said PTC, under consideration for more than 40 years -- which is supposed to slow down or stop a train when there is a problem on the tracks -- could have saved lives.

"Every one of these accidents, in fact, could have been prevented. How many years have we been calling for PTC?" — Robert Sumwalt, chairman, National Transportation Safety Board

“Every one of these accidents, in fact, could have been prevented’’ by Positive Train Control, Sumwalt said, the State newspaper in South Carolina reported. “How many years have we been calling for PTC?’

The system is designed to automatically stop a train before an accident occurs. It uses GPS tracking to monitor train locations, activate the brakes, if a train exceeds a speed limit, and ensure no collision with other trains.

Congress in 2008 instructed Amtrak and other rail operators and agencies to install PTC by the end of 2015, but the plans were delayed in part due to the price tag – reportedly more than $22 billion over 20 years.

In 2015, the lawmakers extended the deadline for the technology’s implementation to Dec. 31, 2018, but it remains unlikely the system will be widely in place by the end of the year. According to the Federal Railroad Administration, the system is in use in just on just 16 percent of tracks for freight railroads and just 24 percent of tracks for passenger railroads.

Federal authorities investigating Sunday's collision claim a railroad switch was locked in a wrong position, making the passenger train go on the wrong track. No evidence of foul play has been found, but the investigation is still underway.

Sumwalt said the passenger train hurtled down a side track near Cayce, S.C., around 2:45 a.m. Sunday after a stop 10 miles north in Columbia because a switch was locked in place, diverting it from the main line. A crew on the freight train had moved the switch to drive it from one side track — where it unloaded 34 train cars of automobiles — to the side track where it was parked. The switch was padlocked as it was supposed to be, Sumwalt said.

“The key to this investigation is learning why that switch was lined that way,’’ Sumwalt said during a news conference, the State reported. He added that “our goal is to find out not only what happened, but why it happened so we can prevent it from happening again.’’

The Associated Press contributed to this story.