Self-described anarchist Cody Wilson tap-danced on the limits of the Second Amendment and criminal conduct when his downloadable gun designs for 3-D printers triggered fear that his on-demand firearms would give criminals untraceable killing tools.

But that is not what landed Wilson in court this time.

The 31-year-old accused of paying for sex with an underage girl last summer pleaded guilty Friday in a Travis County, Tex., courthouse to a reduced charge of injury to a child, the Austin American-Statesman reported. Wilson originally faced a charge of felony sexual assault.

The reduced sentence keeps Wilson out of prison but will require him to register as a sex offender for seven years of deferred adjudication probation.

And Wilson, an outspoken pioneer of firearm technology, cannot own a firearm during that time, the Statesman reported.

The deal reached with prosecutors is contingent on the approval of Texas District Judge Brad Urrutia. If Wilson abides by the probation conditions, the court will not enter a guilty finding, and Wilson will not be convicted of the charge, the Statesman reported.

The September arrest stemmed from an August 2018 incident in Austin, when a girl younger than 17 told police that she met Wilson on SugarDaddyMeet. The app and website advertise matchups between “rich and successful men” and “young and attractive women.” Its policies forbid minors and prostitutes, though the site conducts no background checks.

Wilson’s attorney, F. Andino Reynal, did not return a request for comment. He previously told the Statesman that Wilson believed the girl was of consensual age. The age of consent in Texas is 17.

The girl told police Wilson paid her $500 to have sex in a hotel room. He was later arrested in Taiwan after police accused him of fleeing the investigation. He resigned from his company Defense Distributed soon after the arrest, the Statesman reported.

Wilson fiercely battled the U.S. and state governments over the legality of his work — blueprints of firearms that allow users to download 3-D print gun parts, or in some cases, whole firearms.

Often called “ghost guns,” the do-it-yourself firearms use parts fabricated with a 3-D printer, often in polymer plastic, nylon or metal. Many of the plastic guns break apart after firing a few rounds, though the metal firearms are more durable.

Wilson argued that the blueprints were protected speech. States sued him to prevent the files from being uploaded, and last August, a federal judge agreed with more than a dozen attorneys general to block him from uploading the blueprints. Since then Wilson has used other ways to distribute the files.

Deanna Paul contributed to this report.

Read more: