A New Mexico man accused of paying hackers to sabotage websites affiliated with his former employers and government agencies in Minnesota, including the state’s court system, has been sentenced to 15 years in prison.

The case is one of the first of its kind in Minnesota. The sentencing of John K. Gammell of Las Cruces last week in federal court in St. Paul includes five years of supervised release and restitution that authorities were still trying to determine.

“Gammell’s attacks on the websites of his victims had real consequences to small businesses, educational institutions, government entities, and others — for no reason other than that Gammell wanted to cause them harm,” Assistant U.S. Attorney Timothy Rank said in a statement.

“Gammell used his technical knowledge and the internet’s cloak of anonymity to commit his crimes,” Rank continued, “all while knowing the damage he was causing and believing he would never be caught.”

Gammell pleaded guilty in January to conspiracy to cause intentional damage to a protected computer and being a felon in possession of a firearm. His plea staved off what would have been one of the country’s first federal trials on hacking conspiracy charges.

He admitted to engaging in what prosecutors called a “campaign of distributed denial of service (DDoS) attacks” against at least three dozen websites between 2015 and 2017. Victims included former employers, banks and agencies such as the Hennepin County government, the Minnesota judicial branch, and Dakota County Technical College and Minneapolis Community and Technical College.

According to his plea agreement, Gammell used programs from his own computers and also paid several “DDoS-for-hire” services to try to disrupt websites in Minnesota and elsewhere by flooding them with large amounts of web traffic.

Gammell also targeted business competitors, companies that declined to hire him, and websites for law enforcement, financial institutions and court branches. According to court filings, Gammell caused more than $5,000 in damage while using “IP address anonymization services” to mask his location and paid for the “hacker-for-hire” services using cryptocurrency that can be difficult to trace.

Authorities might not have caught Gammell without the taunting e-mails he allegedly sent after attacks and records of his dealings with an Israeli “hacker-for-hire” service whose files were relayed to the FBI by an unnamed web security researcher.

Also, FBI agents in Colorado found parts used to build AR-15 rifles and 420 rounds of “full metal jacket rifle ammunition” during a search of Gammell’s car last year. Agents also unearthed handguns and hundreds of rounds of ammo in searches of Gammell’s parents’ home in New Mexico and a storage unit that belonged to Gammell.

Gammell lived with his parents in New Mexico before seeking temporary work in Denver, according to court documents.