 -- The suspected gunman in the "Pizzagate" shooting in Washington, D.C., which authorities said was sparked by a fake news story, is now facing federal charges and allegedly said that he could be "sacrificing the lives of a few for the lives of many," according to court documents.

Edgar Maddison Welch was arrested last week and initially faced local charges after allegedly firing an AR-15 assault rifle multiple times inside a pizza restaurant in Washington, D.C., Comet Ping Pong.

Police said Welch told them that he had learned of "news" reports that a child sex-trafficking ring was being conducted in hidden rooms at the pizzeria. He said he decided to investigate the reports on his own, according to the criminal complaint.

The federal charges, which were unsealed today, allege that police discovered cellphone evidence with a trove of text messages to Welch's girlfriend and friends about his plans.

It appears Welch was contemplating a "violent confrontation" at the restaurant since at least Dec. 1, according to the court documents.

In a text message to his girlfriend that day, Welch wrote that he had been researching the "Pizzagate" conspiracy theory and it was making him "sick," the complaint says. In a text to a friend the next day, it says, Welch allegedly wrote that the "cause" was "raiding a pedo ring, possibly sacrificing the lives of a few for the lives of many."

"I'm sorry bro, but I'm tired of turning on the channel and hoping someone does something and being thankful it's not my family. One day it will be our families. The world is too afraid to act and I'm too stubborn not to," he added, according to the complaint.

Welch allegedly told police that on Sunday, Dec. 4, he left his home in North Carolina and drove straight to the restaurant in Washington.

During the drive, he told his girlfriend something to the effect of he "might be gone awhile," according to the documents.

Court documents say he appears to have recorded a cellphone video during the drive in which he looks into the camera and tells family members that he loves them and that he hoped he had "showed it." He added that he hoped he would be able to "tell [them] again," the papers say.

At around 3 p.m., he arrived at the restaurant, where witnesses say they saw Welch holding an assault rifle across his chest, according to the complaint. As he moved toward the back of the restaurant, employees and customers fled the building.

As everyone was fleeing, Welch encountered an employee returning from the back freezer, according to court documents. The employee said Welch pointed the AR-15 rifle in his direction, the documents state, but Welch denied raising the firearm at the employee.

After the customers and employees left the restaurant, police created a perimeter around it, and at about 3:24 p.m. Welch exited the building with his hands in the air, complying with officers.

He told officers that he had an AR-15 and a .38 caliber revolver, both of which were left in the restaurant, according to the complaint. He also admitted to having a loaded shotgun and ammunition in his car.

He told police that while he was inside, he searched for evidence of hidden rooms, tunnels and child sex-trafficking of any kind.

At one point he said he encountered a locked door and attempted to open it with a butter knife, the complaint says. When that didn't work, he fired shots at the lock with his AR-15, documents say. Still unsuccessful, he climbed on top of furniture to look inside the locked room and found it empty, according to the complaint. Welch has been in custody since his arrest. He appeared in court this morning, facing local charges, including assault with a dangerous weapon and unlawful discharge of a firearm. Charges were moved to federal court, where had his initial appearance this afternoon.

Welch is charged with interstate transport of a firearm with the intent to commit a felony. He faces up to 10 years in prison with these new charges.

He was appointed a public defender, who declined to comment beyond what was said in the courtroom. Welch will remain in detention at least until his next hearing, which is scheduled for Friday morning. He has not yet entered a plea.