The white man charged in the shooting deaths of nine people at a historical black church in Charleston, South Carolina, last month had been in contact with white supremacists online, the New York Times reported late Friday, citing federal and local authorities. Dylann Roof opened fire at the Emanuel African Methodist Episcopal Church on June 17.

Authorities reportedly said that investigators found about Roof’s contact with white supremacists as they tried to piece together details about the gunman. However, it did not appear that the supremacists encouraged Roof to carry out the attack, which is being investigated as a hate crime.

“To understand what happened, you have to understand who he talked to and who may have known what,” one law enforcement official said, according to the Times.

Earlier, reports surfaced that people around Roof were aware of his racist beliefs. Friends of the 21-year-old said that they feel guilty about not doing enough to prevent the racially motivated violence. Roof had reportedly spoken to his friends about wanting to start a race war in the weeks before the attack.

Joseph Meek, one of Roof’s childhood friends, told multiple news outlets last month that Roof had changed over the years, and shared racist ideas and plans to “hurt a whole bunch of [black] people.”

A website, purportedly created by Roof, surfaced online and contained a manifesto detailing its author's racist beliefs, according to reports in June. The site also featured photographs of Roof holding weapons and posing with a Confederate flag.

The State newspaper in Columbia, South Carolina, reported that the probe now encompasses associates of Roof who may have had knowledge of his alleged plans. His associates could be charged, if authorities find that they were aware of his plans of conducting the attack. So far, investigators have been able to piece together the communications of Roof in part because his electronic devices, including cellphone and computer, are in their custody. The devices were reportedly scrutinized and examined by special FBI agents and analysts.

Roof faces nine counts of murder and a weapons charge in South Carolina's General Sessions Court, and he could also face a federal jury on hate crime charges. He is being held in the Charleston County jail after a June 19 hearing set a $1 million bond on the weapons charge and no bail on the nine counts of murder.