Police in Newtown, Connecticut, were told years before Adam Lanza's 2012 killing spree that he planned to carry out a massacre at Sandy Hook Elementary School, according to a batch of documents the FBI released this week.

Roughly 1,500 pages of heavily redacted documents show that in 2008, a man told police he'd heard Lanza say he planned to kill students at Sandy Hook, along with his mother, the New York Times reports. When the man went to the cops with what he'd learned, they told him that "Lanza's mother owned the guns and that there was nothing NPD could do about it," according to an FBI file.

It wasn't the only brush law enforcement allegedly had with Lanza before he went on a rampage in Newtown, killing his mother and fatally shooting 20 children and six staffers at Sandy Hook Elementary. In an interview conducted two days after the shooting, Lanza's neighbors told the FBI that Nancy Lanza once said her son had hacked into a government computer when he was a high school freshman. According to USA Today, Lanza's mother told the neighbors that agents from the FBI and CIA came to their house afterward, and that she had to convince them her son was simply bright—that he was "challenging himself to see if he could hack into a government system."

"The authorities told Nancy that if her son was that smart he could have a job with them one day," the document reads, according to CNN. The run-in occurred years before the Sandy Hook massacre; Lanza was 20 when he committed the killings.

According to the Associated Press, the trove of FBI files also suggest Lanza had views about children that verged on pedophilia. According to one document, a woman who communicated with Lanza online told the FBI he had once said sexual relationships between children and adults could be "possibly beneficial to both parties." She also reportedly said Lanza felt "pity for children" who he believed were "brainwashed" by adults.

Additionally, the woman told the FBI, Lanza was apparently fascinated by mass shootings and killings. The documents show he used screen names referring to infamous school shooters, and "devoted almost all of his Internet activity to researching and discussing" mass murders, CNN reports.

According to one FBI document, "Lanza was working on a list, or spreadsheet, meticulously documenting the details of hundreds of spree killings and mass murders."

The FBI documents, which were released due to Freedom of Information Act requests, shed more light on the psyche of a man who committed one of the worst mass shootings in American history. The release comes just weeks after another gunman, Stephen Paddock, fatally shot 58 people in Las Vegas—a killer whose motive investigators are still trying to pin down.

Follow Drew Schwartz on Twitter.