An hours-long FBI raid at a Sterling, Virginia, townhome on Friday was connected to a man who wanted to join ISIS and researched how to make bombs and weapons on the internet, according to court documents.

FBI agents arrested Sean Andrew Duncan Friday and charged him with attempting to obstruct a terrorism investigation. Court documents say Duncan tried to run and get rid of a thumb drive and memory chip he destroyed when agents came to search his home on Courthouse Square.

The court documents lay out a lengthy timeline of Duncan's alleged links to terrorism, including:

In Feb. 2016, one of Duncan's relatives reported to the FBI that "Duncan had converted to Islam, may have been radicalized, and voiced his approval of westerners being beheaded in the Middle East," the documents say.

Duncan and his wife were interviewed by the FBI after traveling to Turkey on Feb. 26, 2016. Duncan deleted his Facebook account two days after being interviewed by the FBI, according to the documents.

Duncan allegedly had contact with a foreign detained ISIS supporter who told the FBI Duncan had expressed interest in joining ISIS and conducting an attack in the United States. The woman said Duncan gave her instructions on how to construct homemade bombs. Duncan would also share news articles with her from Amaq News, an ISIS news outlet, the documents said. The woman also told the FBI Duncan had asked her to go to Syria and to be his second wife.

In June 2017, Alleghany County, Pennsylvania, police gave the FBI a copy of Duncan's phone and the FBI found hundreds of searches for ISIS-related material, ISIS attacks, weapons, body armor, and surveillance and defense tactics, documents said. Alleghany County police had obtained a copy of his phone while investigating the death of Duncan's infant child. The cause of the child's death was inconclusive, documents said.

Alleghany County police found more than 24,000 positive results in Duncan's phone and laptop after searching a list of common counterterrorism terms, documents said.

In Dec. 2017, the FBI found a Twitter account allegedly associated with Duncan's phone number. The Twitter handle was @DawlahtulIslaam, which roughly translates to "The Islamic State."

"Based on my training and experience I know the above-described searches conducted by Duncan are indicative of an individual planning and researching how to conduct an attack and defend himself from severe bodily harm," an FBI agent wrote in the affidavit.

Duncan moved to Sterling in June 2017 from Pittsburgh, Pennsylvania, the documents said.

During Friday's raid, a long line of FBI agents and sheriff’s deputies carried boxes marked with red and black evidence tape out of the townhouse. A mobile command post was used at the scene.

Neighbors to the residence said the home’s occupants just started renting it last summer.

An FBI official said the incident was “authorized law enforcement activity.” Typically with raids of this nature, the purpose will only become public knowledge if charges are filed.

Stay with News4 and NBCWashington.com for updates.