It is unclear what officials could have done to stop the attack at the point they were alerted to Mr. Lanza. All firearms in the Lanza home had been legally purchased by Nancy Lanza, whom Mr. Lanza shot and killed in her bed the morning of Dec. 14 before going to the school and fatally shooting 20 children and six staff members. The rampage ended when Mr. Lanza, 20, shot and killed himself at the school.

Image An undated photograph of Mr. Lanza. Credit... Western Connecticut State University, via Associated Press

The documents — large portions of which were redacted, including the names of numerous interviewees — include accounts by people who knew the gunman or his mother.

In one entry, a woman who had connected with Mr. Lanza online about two and half years before the massacre said she knew he had been obsessed with mass shootings.

“Lanza was working on a list, or spreadsheet, meticulously documenting the details of hundreds of spree killings and mass murders,” agents with the F.B.I. wrote of their interview with her. They said he had devoted all his time to researching these events.

The woman said she communicated with Mr. Lanza about once a month through the beginning of December 2012, but never heard his voice. He was “the weirdest person online,” she told investigators.