A computer hacker who helped the Islamic State by providing names of more than 1,000 U.S. government and military workers as potential targets was sentenced Friday to 20 years in prison.

The sentence was much higher than the 6-year term sought by defense lawyers, who argued that their client, Ardit Ferizi, meant no real harm and is not a true supporter of the Islamic State.

"He was a nonsensical, misguided teenager who did not know what he was doing," said public defender Elizabeth Mullin. "He has never embraced ISIL's ideology."

Ferizi, 20, a native of Kosovo who was arrested last year in Malaysia, is the first person convicted in the U.S. of both computer hacking and terrorism charges. He admitted hacking a private company and pulling out the names, email passwords and phone numbers of about 1,300 people with .gov and .mil addresses. The Islamic State published the names with a threat to attack.

At Friday's sentencing hearing, Ferizi struggled to explain why he did it, when asked directly by U.S. District judge Leonie Brinkema for an explanation. He said that it all happened very quickly.

"I feel so bad for what I did," he said in Albanian-accented English. "I am very sorry for what I did, making people feel scared."

Prosecutors asked for the maximum sentence of 25 years.

"The defendant's conduct has indefinitely put the lives of 1,300 military members and government workers at risk," said Assistant U.S. Attorney Brandon Van Grack.

He disputed the idea that Ferizi's crime was a whim. Before turning over the names to the "Islamic State Hacking Division" las year, he operated a website devoted to propagating the Islamic State's propaganda. In online conversations, Ferizi defended the Islamic State, and when he gave the 1,300 identities to the Islamic State, he knew he was putting them in would-be terrorists' crosshairs, Van Grack said.

"This was a hit list. The point was to find these individuals and hit them, to 'strike at their necks,'" Van Grack said, mimicking the language the Islamic state used when it published the names.

Van Grack quoted a letter from one of the victims, who said she has an easily identifiable name and is now nervous when she interacts with Muslims, something she feels guilty about. And Van Grack cited another terror case in northern Virginia, in which the defendant, Haris Qamar, allegedly staked out two of the addresses of people in the list who lived near him in the town of Burke.

Mullin countered that nobody on the list has actually been harmed, and said that much of the information Ferizi helped disseminate was publicly available anyway.

Court papers describe a difficult life for Ferizi, who was nominally raised as a Muslim and was just 4 years old when NATO airstrikes forced Serbian forces to withdraw from the territory, which subsequently became independent. Ferizi's uncle was murdered and his father was kidnapped during the war, according to letters written by Ferizi's family.

As a teenager, Ferizi got in trouble for hacking into Kosovar government databases, but he avoided jail. Ferizi went to Malaysia to study cybersecurity, but continued his hacking activities and developed worsening mental health problems, defense lawyers said.

He met an Islamic State recruiter over the internet while he was trying to expose online pedophiles, his lawyers said.