Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

HONOLULU — A soldier based in Hawaii was sentenced Tuesday to 25 years in prison for trying to help the Islamic State group.

Sgt. 1st Class Ikaika Kang, 35, pleaded guilty in August to four counts of attempting to provide material support to a foreign terrorist organization. He provided classified military documents, a drone and other help, he said.

"Your honor, I know what I did was wrong," Kang said before Senior U.S. District Judge Susan Oki Mollway imposed a sentence that includes 20 years of supervised release. "When I'm released I won't do it again."

The sentence is part of a plea agreement. If convicted at a trial, Kang, 35, could have faced life in prison.

He provided the support to undercover agents Kang believed were part of the Islamic State group, which is also known as ISIS.

"The conduct that you committed was extremely serious," Mollway said. "It had the potential to be disastrous."

In this image taken from FBI video on July 13, 2017, Army Sgt. 1st Class Ikaika Kang holds an Islamic State group flag after allegedly pledging allegiance to the group at a house in Honolulu. U.S Attorney's Office, District of Hawaii / AP file

More than six years ago, Kang became sympathetic to the group and to terrorism, Mollway said, and that by 2016 he talked about wanting to join and commit violence.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Kang watched hours of videos daily of violence including beheadings, shootings, suicide bombings and child soldiers, Mollway said.

Kang provided voluminous, digital documents that had sensitive information including the U.S. military's weapons file, details about a sensitive mobile airspace management system, various military manuals and documents containing personal information about U.S. service members, prosecutors said.

Trained as an air traffic controller with a secret security clearance, Kang also provided documents including call signs, mission procedures and radio frequencies, prosecutors said.

"You had a distinguished career in the United States Army. And you had access and training that would have been valuable to the people associated with ISIS," Mollway said.

At one of the meetings with agents Kang believed were part of the Islamic State, he swore loyalty to the group in Arabic and English and kissed an Islamic State flag given to him by a purported Islamic State sheikh, prosecutors said.

He then said he wanted to get his rifle and fight — "just go to downtown Honolulu and Waikiki strip and start shooting," prosecutors said in a news release in August.

Soon after Kang's arrest, defense attorney Birney Bervar said his client may suffer from service-related mental health issues that the government was aware of but neglected to treat.

Several letters of support filed in court allude to mental health concerns. An older sister wrote that Kang grew up in an abusive home and that the violence increased when their mother started using crystal methamphetamine.

The sister, who cried as she watched the sentencing hearing, declined to comment afterward.

Letters by former Army colleagues described how Kang seemed easily influenced.

Kang would stare at a wall for hours and would say, "I'm just listening to the sound of the blood running through my veins," wrote retired Sgt. 1st Class Thomas Maia, who was Kang's supervisor when they were stationed at Fort Rucker, Alabama.

Maia described another incident when Kang got agitated by seeing a cat that he said "was talking to him and trying to take his soul."

Bervar requested Kang be sent to a detention facility where he can receive mental health help.

Kang is still in the Army, but he isn't being paid while in civilian confinement. Bervar said he expects the Army will soon move to discharge him.