The federal government has approved a nearly $1 billion loan to the Metropolitan Transportation Authority to improve safety on Metro-North and the Long Island Railroad.

It's the largest loan in MTA history—meant to pay for positive-train-control systems.

The new technology is designed to reduce human errors that lead to derailments and train collisions.

Officials say positive-train-control could have prevented incidents such as 2013's deadly Metro-North derailment in the Spuyten-Duyvil section of the Bronx.

Congress mandated the technology be installed on commuter railroads in 2008.

The MTA will have over two decades to repay the loan.