A 27-year-old Michigan man pleaded guilty last week to hacking the computer network of a county jail in an effort to modify records and get an inmate released early, according to court documents .

Konrads Voits, a resident of Ann Arbor, Michigan, pleaded guilty of one count of damaging a protected computer stemming from his attempts to get a friend released from the Washtenaw County Jail.

According to a complaint first filed by the Federal Bureau of Investigation (FBI) on July 5, Voits used a social engineering campaign—including making phone calls and sending spear-phishing emails—targeted at employees of Washtenaw County Jail employees in an attempt to trick the workers into downloading and running malware on their computers.

In the emails, Voits presented himself as a man named Daniel Greene and claimed to be a former inmate of the jail getting in touch to ask if his court record was “being leaked” online. The emails contained a link to the domain ewashtenavv.org —a site Voits registered and mocked up the site to look identical to the Washtenaw County’s official government portal, which is hosted at ewashtenaw.org .

According to domain records, the phishing site set up by Voits—which now appears to be offline—was registered under a fake name and connected to an email address hosted by ProtonMail, a secure and encrypted email service.

Had employees of the jail clicked the link included in the emails, they would have been directed to a site that would download malware onto their machine. None of the employees visited Voits’ site and in response, Voits began a telephone campaign.

In February, Voits began calling the jail and posing as an information technology employee working for the county government. During the calls, he told the employees that he required assistance updating XJail, a program that is used to maintain jail records.

While on the call, Voits would ask the jail employee to visit a website hosted on a URL shortening service designed to obscure the true destination of the URL. When entered, the URL would redirect the user to a page that hosted malware. After several attempts, Voits was able to successfully trick an employee into downloading and installing malware on the jail computer network.

Once the malware was installed, Voits was able to gain full access to the County network, including search warrant affidavits, internal discipline records and County employee personal information.

Voit used the access to steal passwords, usernames and email addresses from more than 1,600 County employees. He also accessed the records of several inmates and modified the entry of at least one in “an effort to get that inmate released early.”

While Voits succeeded in his attempt to hack the County jail’s computer network, the modifications to the system were noticed immediately by County employees and the activity was reported to the FBI.

Investigators were able to link the email that registered the fake county portal domain to a box.com account, also registered to the same email, that was storing the stolen county employee information. Upon executing search warrant, investigators found a computer in Voits’ home that had the same email address open on its screen. Voits was arrested shortly after.

After pleading guilty, Voits faces up to 10 years in prison and could face a fine up to $250,000. He will also be required to forfeit all electronics equipment used to carry out the attack on the jail, including a laptop, four phones, a circuit board and an undisclosed amount of Bitcoin. Voits will face a sentencing hearing on April 5, 2018.