(Reuters) - A U.S. Army sergeant described by former colleagues as a one-time “model soldier” was sentenced to 25 years in prison at a federal court in Hawaii on Tuesday after pleading guilty to providing material support to the Islamic State militant group, a local news outlet reported.

FILE PHOTO: A photograph with a redacted date, and entered into federal court as an exhibit to support the government's motion to keep U.S. Army Sergeant Ikaika Erik Kang in detention without bond, shows what is described as Kang holding the Islamic State Flag after pledging allegiance to the Islamic State. Kang is charged with trying to provide material support to Islamic State extremists. U.S. District Court for the District of Hawaii/Handout via REUTERS

Ikaika Erik Kang, 35, agreed to a plea deal in August on four counts of breaking antiterrorism laws in which he accepted a proposed 25-year sentence.

Judge Susan Oki Mollway accepted the terms of the plea deal at Tuesday morning’s hearing, Hawaii’s KHON2 news channel reported. Kang told the court he knew what he did was wrong, KHON2 reported.

Kang had begun expressing support for Islamic State, which the United States deems a foreign terrorist organization, by early 2016, according to the U.S. Department of Justice.

Undercover agents from the Federal Bureau of Investigation began meeting with Kang earlier this year, some of them posing as members of the militant group.

Kang gave them military gear and classified documents and agreed to teach them hand-to-hand combat in a video-recorded session, according to federal prosecutors.

Lawyers for Kang filed three letters of support in court that described him as a diligent but withdrawn soldier who struggled with his mental health.

Kang’s older sister, Erika Takahashi, wrote that Kang grew up in a “very abusive household,” adding that he “is a good person on the inside.”

Two soldiers who worked with Kang in air-traffic control at Alabama’s Fort Rucker military post used their letters to urge the judge to help Kang get counseling.

Thomas Maia, who was Kang’s first supervisor at Fort Rucker, called Kang a “model soldier” but said he had worried about Kang’s odd behavior. This included staring at a wall for hours on end, saying he was trying to listen to the sound of his blood running through his veins, Maia wrote.

Maia wrote that his efforts to secure a mental health evaluation for Kang were rebuffed.

“He didn’t seek out ISIS on his own, he was approached and socially engineered by the FBI at the Army’s request,” Maia wrote, using an acronym to refer to the Islamic State. “If he would have been given adequate mental treatment back when I asked for it, none of this would have happened.”

Federal prosecutors say Kang agreed to swear an oath of loyalty to Islamic State in a pseudo-ceremony organized by the undercover FBI agents. After the ceremony, Kang told the agents he was ready to take his rifle to downtown Honolulu and start shooting, whereupon he was arrested.