A veteran officer with Metro Transit Police was charged Wednesday morning with trying to help ISIS, including an attempt to send $245 through gift cards to militants overseas.

WASHINGTON — A veteran officer with Metro Transit Police appeared in court federal court Wednesday afternoon to face a charge that he attempted to aid the foreign terrorist group known as ISIS.

Nicholas Young, 36, of Fairfax, is accused of purchasing $245 worth of gift cards last week that were intended to make it easier for overseas militants to communicate with potential recruits in western countries.

During the brief appearance in U.S. District Court in Alexandria, Young wore his police uniform pants plus a white T-shirt that exposed his tattoos. He had a beard and nearly collar-length hair. He was flanked by federal marshals, and was handcuffed and shackled. A magistrate ordered him held until a status hearing on Thursday. The soft-spoken Young also requested a court-appointed attorney.

The 13-year-officer was arrested at Metro headquarters Wednesday morning, capping an investigation that Metro Transit Police initiated years ago and that was loosely connected to two other men who have are now serving prison sentences for terrorism-related charges.

FBI spokesman Andrew Ames confirmed that Young is the first law enforcement officer to be charged under the federal government’s terrorism law, The Associated Press reported.

Joshua Stueve, spokesman for the U.S. attorney for the Eastern District of Virginia, told The Associated press that Young posed no threat to the Metro system, and nowhere in the affidavit does it mention Metro or Metrobus system.

Young was terminated upon his arrest, Metro spokesman Dan Stessel told WTOP.

“Since I received my first briefing on this matter, Chief Pavlik and I have worked hand-in-glove with the FBI in the interest of public safety and to ensure that this individual would be brought to justice,” said Metro General Manager Paul Wiedefeld.

“Metro Transit Police alerted the FBI about this individual and then worked with our federal partners throughout the investigation up to and including today’s arrest. Obviously, the allegations in this case are profoundly disturbing. They’re disturbing to me, and they’re disturbing to everyone who wears the uniform,” Wiedefeld said.

Metro Transit Chief Ron Pavlik thanked federal investigators for their work, which led to the charges.

“This investigation began with concerns that were reported by the Metro Transit Police Department, and it reinforces that, as citizens, we all have a duty to report suspicious activity whenever and wherever it occurs,” Pavlik said.

Young is charged with a single count of attempting to provide material support to a foreign terrorist group. The charge carries a maximum penalty of 20 years in prison.

According to charging documents, on Thursday Young sent the numeric codes for 22 gift cards to an individual he believed had joined ISIS. The gift cards were intended to help the group pay for new mobile messaging accounts that could then be used to communicate with potential militant recruits living in western countries.

Instead, the codes were received by an FBI agent posing as a militant. When the FBI redeemed the gift cards, they were worth $245.

Young believed he had been communicating with a militant who had supposedly joined the Islamic State group after leaving the U.S. in late 2014. During an interview with the FBI, allegedly about the militant, Young told investigators that his friend had gone on a vacation to Turkey but that he never heard from him again. But court documents state that Young continued to communicate with the man he believed was a militant through email and later through a mobile messaging app.

Young sent the codes at the prodding of the FBI agent posing as a militant, who suggested that ISIS could use the gift card codes.

According to court records, Young also provided advice on how to join ISIS to the militant, whom Young believed was a military reservist of Middle Eastern descent. Young instructed the man about what gear to take with him, how to avoid the suspicion of authorities and cautioned that it could take several weeks to cross the border between Turkey and Syria.

He also counseled that the man didn’t have to join the Islamic State group.

Years of scrutiny

Metro Transit Police first went to the FBI with concerns about Young in 2009, a law enforcement official told WTOP.

The FBI interviewed Young at least four times dating back to 2010. And as a result of statements that Young made to an undercover officer, the FBI decided to launch an aggressive operation. The Joint Terrorism Task Force was involved from the earliest stages, officials said.

According to court documents, the first interview was focused on Young’s acquaintance Zachary Chesser, of Bristow, who later pleaded guilty to providing material support to the Somali terrorist group al-Shabaab. He was sentenced to 25 years in prison.

In a 2011 interview with the FBI, Young said that he traveled twice to Libya that year to fight with rebels to overthrow Moammar Gadhafi. During a trip in May 2011, Customs and Border Enforcement found Young traveling with body armor, a Kevlar helmet and other “military style items.” A search on Young’s return trip found that Young still had the body armor.

Investigators believe that Young spent as many as several months there the first time. He spent just two weeks during a subsequent trip.

An undercover officer recorded numerous conversations with Young, including meetings with Amine El Khalifi, who was arrested in February 2012 in an FBI sting operation. Khalifi, of Alexandria, eventually pleaded guilty to charges related to a planned suicide bombing at the U.S. Capitol. Khalifi was sentenced to 30 years in prison for the plot.

Young, the undercover officer and Khalifi went out to eat on several occasions. During one of those meals, Young said he had been stockpiling weapons and suggested he would use the guns, body armor and even “amphetamines” should police ever search his home. During another meal, Young warned Khalifi to be careful about what he posted online.

Mounting paranoia

A Metro Transit officer told investigators about some of the weapons Young owned, including numerous assault-style rifles. The officer said that Young once told him he wanted to buy a “crate” of World War II-era Russian Negant rifles to “hand out if things went bad.”

Charging documents describe Young’s paranoia that he was under surveillance. He believed that his emails were being read and his phone calls were monitored.

He told an undercover officer that he once pointed a rifle out of the window of his home while “scanning” for law enforcement surveillance.

Young also said that if anyone ever betrayed him, “that person’s head would be in a cinder block at the bottom of Lake Braddock.”

Last summer, Young sent an email to the man he thought was a militant with ISIS asking for advice on how to move his money offshore. “I have enough flags on my name that I can’t even buy a plane ticket without little alert ending up in someone’s hands, so I imagine banking transactions are automatically monitored,” the email read.

Run-ins with local police

In addition to meetings with undercover investigators and interviews with the FBI, Young also had several encounters with local law enforcement during the time he was being investigated, the documents said.

In 2011, he was stopped for making an illegal U-turn in Falls Church. He told the undercover officer, that he didn’t tell the officer who pulled him over that he was also a cop because he was supposed to be on duty at the time and that he was not at work, according to the affidavit.

Court records show he paid the $91 ticket for the moving violation.

And last summer, police spoke to Young at his home as part of a domestic violence investigation.

WTOP’s Kristi King, J.J. Green and Max Smith contributed to this report.