Washington CNN  — 

Four years before North Korea hacked into Sony Pictures Entertainment’s servers and published private information, the United States began cracking into North Korean computer networks and tracking the movements of its government hackers, the New York Times reported Monday.

The information collected through the classified National Security Agency program helped U.S. intelligence officials assess North Korea’s involvement in the cyberattack and ultimately led President Barack Obama to directly blame North Korea for the attack, according to a Times report that cited current and former U.S. and foreign officials with knowledge of the program.

Starting in 2010, the NSA broke into Chinese networks connecting North Korea to the World Wide Web and embedded malware into the networks used by North Korea’s cyberspies, including those working in the Bureau 121 unit believed to be responsible for the Sony hack.

Within weeks of the first attacks, U.S. officials and eventually Obama said North Korea was responsible for hacking into Sony’s servers, publicizing private salary information and personal correspondence and ultimately threatening a terrorist attack if Sony released the movie, “The Interview.” North Korea had called releasing the movie, which depicted a comedic plot to assassinate North Korean leader Kim Jong Un, an “act of war.”

The NSA’s efforts helped the U.S. develop what officials described to the Times as an “early warning radar,” though only after the fact were U.S. intelligence officials able to link the Sony attacks to the North Korean government.

Private cybersecurity companies raised doubts about the certainty and veracity of the FBI and other U.S. agencies’ claims that North Korea was behind the attack on Sony, but U.S. officials have remained firm in their conclusions and had cited additional classified information that the private companies could not access.

The U.S. hit North Korea with additional economic sanctions targeting specific individuals early this year, keeping good on its promise to retaliate against North Korea for the attack on Sony.

North Korea also experienced widespread internet outages in late December and blamed the United States. U.S. officials declined to comment on the outages.

Sony Pictures ultimately released “The Interview” in select movie theaters and through YouTube.

North Korea to U.S.: Show evidence that we hacked Sony