A criminal complaint obtained by Fox News is detailing how the FBI traced Massachusetts Air National Guardsman Jack Teixeira to a series of sensitive document leaks that have threatened to upend the U.S. government's relations with allies worldwide. 

Teixeira, 21, did not enter a plea during an initial appearance in federal court in Boston Friday after being charged with unauthorized retention and transmission of national defense information and unauthorized removal and retention of classified documents or material.

The FBI says its pursuit of Teixeira – who was arrested Thursday at his home in North Dighton, Massachusetts – gained momentum earlier this week when agents interviewed a user of a social media platform, known to be Discord, who told a special agent that an individual began posting "what appeared to be classified information" there starting in December 2022. 

Discord, which is popular with online gamers, says it is cooperating with the federal investigation.

The postings from that individual, later identified to be Teixeira, appeared on a group aimed at discussing "geopolitical affairs and current and historical wars," according to the person. 

PENTAGON LEAK SUSPECT JACK TEIXEIRA CHARGED IN FEDERAL COURT, TELLS DAD ‘I LOVE YOU’ 

Selfie Jack Teixeira alleged leaker

Jack Teixeira, the 21-year-old National Guard Airman accused of leaking classified information. (Facebook)

The social media user, whose name is not published in the affidavit, said Teixeira first started sharing paragraphs of text, but around January of this year, began posting images of documents that "contained what appeared to be classification markings." 

One of the documents, prosecutors say, "described the status of the Russia-Ukraine conflict, including troop movements, on a particular date" – information that is "based on sensitive U.S. intelligence, gathered through classified sources and methods, and contains national defense information." 

The user said he engaged in conversations with Teixeira and at one point, the young man "explained that he had become concerned that he may be discovered making the transcriptions of text in the workplace, so he began taking the documents to his residence and photographing them." 

Based on conversations this user had with Teixeira, he further learned his first name was Jack and "appeared to reside in Massachusetts, and claimed that he was in the United States Air National Guard," according to the complaint. 

WHO IS JACK TEIXEIRA, THE AIR NATIONAL GUARDSMEN ALLEGEDLY BEHIND LEAKED CLASSIFIED DOCUMENTS?   

A federal police vehicle is parked outside U.S. District Court

A federal police vehicle is parked outside U.S. District Court in Boston, Massachusetts on Friday, April 14, as Massachusetts Air National Guardsman Jack Teixeira appeared for an initial hearing after being accused of leaking highly classified military documents. (AP Photo/Mark Pratt)

Investigators then obtained records from the social media platform, which they used to link Teixeira to the account that had been disclosing the information, the complaint said. 

Prosecutors, citing government records and information, said Teixeira has been serving as an airman first class in the U.S. Air National Guard since May 2022 and has been stationed at Otis Air National Guard Base in Cape Cod, Massachusetts.  

READ THE AFFIDAVIT - APP USERS, CLICK HERE:

As of Feburary 2023, his title was cyber defense operations journeyman. 

"As required for this position, Teixeira holds a Top Secret security clearance, which was granted in 2021," the FBI special agent wrote in the complaint. "Based on my training and experience, I know that to acquire his security clearance, Teixeira would have signed a lifetime binding non-disclosure agreement in which he would have had to acknowledge that the unauthorized disclosure of protected information could result in criminal charges." 

Jack Teixeira is arrested

Jack Teixeira, in a T-shirt and shorts, is seen being taken into custody by armed tactical agents on Thursday, April 13, 2023, in Dighton, Massachusetts. (WCVB-TV via AP)

Just prior to his arrest, on April 6, Teixeira "used his government computer to search classified intelligence reporting for the word ‘leak,’" the complaint also said. 

"Accordingly, there is reason to believe that Teixeira was searching for classified reporting regarding the U.S. Intelligence Community’s assessment of the identity of the individual who transmitted classified national defense information," it added. 

Attorney General Merrick Garland on Friday said, "The Department of Defense is leading an important effort now to evaluate and review the national security implications and most important, to conduct a review of the methods of access, accountability and control procedures that the Department has so that something like this can never happen again."

WATCH: TEIXEIRA'S DAD LEAVES COURTHOUSE:

Garland declined to say if there is a "foreign nexus" to the leak case. He confirmed that the case will be pursued in federal court but did not say if Teixeira will also face military charges.

"This is not just about taking home documents," Garland said. "That is, of course, itself illegal. But this is about the transmission, both the unlawful retention and the transmission of the documents. Everyone knows here that the documents in the end were transmitted. That violates 18 U.S.C. 793, an 18 U.S.C. 1924. There's very serious penalties associated with that."

CLICK HERE TO GET THE FOX NEWS APP 

"People who sign agreements to be able to receive classified documents acknowledge the importance to the national security of not disclosing those documents," he continued. "And we intend to send that message, how important it is to our national security."

Fox News’ Marta Dhanis contributed to this report.