In one encounter on June 23, Sergeant Kang offered classified military documents, according to the indictment. In another meeting, on July 8, he volunteered equipment to the undercover sources, including a drone camera, a chest “rig” that holds ammunition and other kinds of “military-style clothing.” A news release from the Justice Department said the case was investigated by the F.B.I. and the United States Army’s Criminal Investigation Division.

According to an F.B.I. affidavit filed in federal court on July 10 and obtained by The Associated Press, the sergeant, an air traffic controller at Wheeler Army Airfield in Hawaii, described fantasies about killing fellow military members and pledging loyalty to Abu Bakr al-Baghdadi, the leader of the Islamic State. His commanding officers called in the F.B.I. when they feared he had become radicalized.

Sergeant Kang made copies of secret military documents in 2015, hoping to give them to the Islamic State, the affidavit said. When he met with the undercover F.B.I. agents, they made training videos that he thought would be taken to the Middle East to supply the terrorist group. The same day that the training videos were produced, Sergeant Kang and one of the undercover agents went shopping for the drone that he expected to give to the Islamic State.

Sergeant Kang’s reported radicalism — which drifted into expressions of support for Hitler and the assailant in a mass shooting at a gay nightclub in Orlando, Fla., according to the affidavit — appeared to be a late development for someone who had an established career in the Army.

He joined the Army in 2001, served in South Korea in 2002 and 2003, and then in Iraq and Afghanistan between 2010 and 2014. It was not until his later deployments that he began to show signs of extremism. His military clearance was taken away in 2012 after he made comments invoking the Islamic State, and was reinstated when he completed military requirements to renew his clearance, according to the affidavit.