Adam Lanza expressed his desire to commit the Sandy Hook massacre years before the tragedy took place — and when a witness alerted police, cops said there was nothing they could do, newly released FBI documents reveal.

In 2008, the witness, whose name has been redacted, heard Lanza (inset) say that he had access to assault weapons and planned to kill students at the elementary school, along with his mother, Nancy Lanza, according to a cache of documents released this week.

“Lanza allegedly [said] that he planned to kill his mother and children at Sandy Hook in Newtown, Connecticut,” the document reads.

The revelation was first reported by The New York Times on Thursday.

The witness said the conversation took place sometime between Dec. 6 and Dec. 24, 2008. The massacre happened on Dec. 14, 2012, when Lanza gunned down 20 first-graders and six staffers at Sandy Hook Elementary School after first killing his mother in their home.

The man told the feds 12 days after the bloodbath that he had alerted the Newtown Police Department about the disturbing information after being privy to the conversation about the plot.

Newtown police responded that “Lanza’s mother owned the guns and that there was nothing N.P.D. could do about it,” according to the records.

The witness said his story could be corroborated by phone records from his home land line as well as travel records.

He said he was driven to let investigators know he had contacted police four years earlier because he felt “bad about not doing more to try and prevent” the massacre from taking place.

In addition to Lanza’s talking about the plot, the newly released documents also revealed his obsession with mass shootings and his interest in pedophilia.

State investigators said they had found a file on the 20-year-old Lanza’s computer that they described as “advocating pedophiles’ rights and the liberation of children.”

A woman who met Lanza online about two years before the shooting told the FBI that he may have believed he was “saving” children from the “harmful influences” of adults during the school shooting.

The documents also reveal that federal agents may have visited Lanza’s home prior to his mass shooting, when he hacked into a government computer system.

The new information raises questions about what more could have been done to prevent one of the most horrific mass shootings in American history.