(AP) — A U.S. soldier who was recently arrested on terrorism charges expressed support for the Islamic State group as early as 2011, but remained in the Army for years while the military and the FBI investigated to determine whether he posed a threat, authorities said.

Sgt. 1st Class Ikaika Kang was taken into custody over the weekend after the 34-year-old veteran of deployments to Iraq and Afghanistan declared his loyalty to the terrorist group and exclaimed that he wanted to “kill a bunch of people,” according to authorities.

The case highlights the challenges investigators face with protecting the public from a potentially dangerous actor on one hand and gathering sufficient evidence to enable prosecution on the other.

AP

Kang is on record making pro-Islamic State comments and threatening to hurt or kill other service members back in 2011, according to an FBI affidavit filed Monday in federal court.

The Army revoked his security clearance in 2012, but gave it back to him the following year. Last year, the Army called the FBI when it “appeared that Kang was becoming radicalized,” the affidavit said.

Retired Army judge and prosecutor Col. Gregory A. Gross said he was perplexed that the Army allowed Kang to remain a soldier even after his favorable comments toward the Islamic State group.But Gross said the Army may have decided Kang was just mouthing off and was not a threat.

Gross served as the initial judge in the court martial of Maj. Nidal Malik Hasan, an Army psychiatrist who killed 13 people and wounded more than 30 in a 2009 shooting at Fort Hood, Texas. He said Tuesday he was concerned by the similarities between Kang and Hasan’s case.

“He was making all these statements, and giving these presentations,” said Gross, who is currently a civilian defense attorney for military service members.

Lt. Col. Curtis J. Kellogg, a spokesman for the 25th Infantry Division, declined to comment, citing the ongoing investigation.

Kang’s court-appointed lawyer, Birney Bervar, said his client may suffer from service-related mental health issues of which the government was aware but neglected to treat. He declined to elaborate.

AP Noel Tipon, an attorney in military and civilian courts, said there’s nothing in the Army manual on removing soldiers from the service that would address allegations like speaking favorably about a group like Islamic State. He suspects the FBI wanted Kang to stay in the Army while they investigated whether he had collaborators. “They probably said ‘let’s monitor it and see if we can get a real terrorist cell,’ ” said Tipon, who served in the Marine Corps. The FBI said its investigation showed Kang was acting on his own. Spokesman Arnold Laanui said the probe took nearly a year given the evidence that needed to be collected and the constitutional rights that needed to be protected. “These tend to be very meticulous and time-consuming matters,” Laanui said. Public safety, he said, was at the forefront of the case, he said. The FBI outlined its evidence against Kang in a 26-page affidavit filed Monday. It includes allegations Kang filmed a combat training video for Islamic State and bought a drone he believed would be sent to the Middle East to help the group’s fighters. Agents said none of the military documents — classified and unclassified — Kang gave to people he believed were affiliated with Islamic State ever got to the group. Kang’s father told Honolulu television station KHON and the Star-Advertiser newspaper his son may have had post-traumatic stress disorder. Kang told the newspaper he became concerned after his son’s return from Afghanistan. He said his son was withdrawn. Kang enlisted in the Army in December 2001, just months after the Sept. 11 attacks. He served in South Korea from 2002 to 2003. He deployed to Iraq from March 2010 to February 2011 and Afghanistan from July 2013 to April 2014. Kang was scheduled to appear in court Thursday for a detention hearing.

Here’s a look at a timeline of events that took Kang from his home in Hawaii to wars in the Middle East and eventually on to a federal detention center facing terrorism charges, accused of pleading allegiance to the Islamic State group and wanting to commit a mass shooting:

2001

Kang enlisted in the Army just months after the Sept. 11 attacks.

2002-3

Kang served in South Korea.

2010

Kang deployed to Iraq in March

2011

Kang returns from Iraq in February. Over the course of the year, Kang was repeatedly reprimanded for threatening to kill other service members and making pro-Islamic State group arguments while on duty.

2012

Kang’s security clearance was revoked because of concerns about the death threats and Islamic State comments.

2013

After completing requirements set forth by the military in response to Kang’s actions, his security clearance was reinstated. According to the FBI, a CD with classified documents that was later found in Kang’s possession was created in June. In July, Kang was deployed to Afghanistan and returned in April 2014.

2016

• August: Kang appeared to start becoming radicalized, and the Army contacted the FBI to begin an investigation.

• September: A confidential FBI informant reported that Kang was talking about radical Islam more frequently. He was heard talking about religion, the Islamic State group and expressing anti-government views. The confidential informant also reported that Kang was listening to a Muslim leader who was killed in 2000 recite the Quran.

• October: Kang went to the Air Traffic Control Operator Senior Leadership Course at Ft. Rucker in Alabama.

• November: The FBI searched his belongings while at the training program in Alabama and took data from his laptop and an external hard drive that contained classified military documents. They also found videos and files referring to terrorist groups and violence. An undercover FBI agent posed as a guest lecturer at the training program and was introduced to Kang.

The two spent several days interacting, including going to a mosque to pray together. Kang then told the FBI agent that he wanted to travel to Turkey to visit an Islamic State group consulate, but that he was afraid he would be arrested if did so. The undercover agent told Kang that he thought the Islamic State could use his skills, and Kang said that he wanted to provide training to their fighters.

The FBI agent told Kang that he knew a militant who would be traveling to Hawaii, and could arrange a meeting.

• December: Kang returned to Hawaii. Around the middle of the month, the FBI searched his home in Waipahu and found a CD marked secret that they say contained the same classified documents they found on his hard drives.

2017

• January-February: Kang reportedly continued making pro-Islamic State statements to other soldiers, including that he would not shoot at fighters if he was deployed to Iraq. He also said he thought the Sept. 11 attacks were an inside job conducted by the United States. Kang received “negative counselling statements” from the Army and was told to stop making such remarks.

AP

• March: Kang told an FBI informant that he had been researching online videos about the most effective and painful torture techniques because he was angry that a civilian had taken away his air traffic control license.

The FBI document says that Kang wanted to “tie him down and pour Drano in his eyes.” Kang also said the Pulse Nightclub shooter in Orlando “did what he had to do” and that “America is the only terrorist organization in the world.” He also said that “Hitler was right” and supported the mass killings of Jews.

• May: The FBI’s undercover investigation continued, and they made arrangements for Kang to possibly take part in a training course on the mainland that could help the Islamic State group.

• June: Kang met with undercover agents in a hotel room and transferred military documents, including classified documents originally obtained in 2013, to the agents, who Kang believed would pass them along to the Islamic State. The agents offered Kang the opportunity to take payment for his help, but Kang declined. The agent also told Kang that he could arrange a meeting with an actual Islamic State member, and Kang responded, “Hell yeah.”

• July: On July 7, Kang met with the undercover agents at a house in Honolulu, where they introduced him to a man Kang believed to be a member of the Islamic State group. Kang told the men that he would provide training and help them with acquiring drone technology that could help the terrorist group fight U.S. forces. He brought firearms, knives and tactical gear to the house. The agents told Kang that he could come back to the house the next day.

On July 8, Kang was introduced to a man he was told was an Islamic State leader. The men discussed and then purchased a drone that Kang told them they could use to escape battles involving U.S. tanks. Kang then swore a pledge of loyalty to the Islamic State and received a folded Islamic State flag as a gift.

He then told the undercover agents that he wanted to kill “a bunch of people,” but was urged to wait until the drone was out of the country and they could make a better plan. The men then made training videos for about two hours and watched them together.

Kang was then arrested by an FBI SWAT team without incident. According to court documents, Kang waived his Miranda rights and admitted to his role in the crimes.