The Federal Bureau of Investigation said it thwarted a “potential terrorist attack” on New Year’s Eve in North Carolina.

Christian Sturdivant, 18, has been charged with attempting to provide material support to a foreign terrorist organization.

James C. Barnacle Jr., special agent in charge of the FBI’s Charlotte field office, said at a press conference Friday that Sturdivant “pledged his loyalty to ISIS and committed himself to killing Americans on New Year’s Eve.”

Barnacle said the FBI investigated Sturdivant for two weeks, with undercover agents posing as ISIS affiliates online.

“During his online communications with the [agent], Sturdivant said, ‘I will do jihad soon,’ and proclaimed he was ‘a soldier of the state,’ meaning ISIS,” the U.S. Attorney’s Office for the Western District of North Carolina said in a statement.