Cody Wilson, the Austin man who sparked a nationwide legal fight over the constitutionality of firearms made with a 3D printer, pleaded guilty Friday in connection with having sex with an underage 16-year-old girl last year.

Wilson, through a tentative plea agreement his lawyers reached with Travis County prosecutors, pleaded guilty to a reduced charge of injury to a child in exchange for a recommended sentence that will keep him out of prison but requires him to register as a sex offender for seven years while he serves deferred adjudication probation. Wilson, who forfeited his firearms last year when he was released from jail on bond, will not be able to own a gun while he's on probation.

Wilson, wearing a gray suit and accompanied by his two lawyers, appeared before state District Judge Brad Urrutia. The judge ordered a pre-sentence investigation report that will guide his decision on whether to accept the plea deal, which he likely will. If Wilson abides by the conditions of the probation, the court will not enter a finding of guilt and Wilson will not be convicted of the charge.

Wilson, who will be formally sentenced Sept. 12, declined to comment through his attorney outside of the courtroom.

Prosecutors say Wilson arranged to meet up with the teen girl in September 2018 after connecting with her on the dating website SugarDaddyMeet.com. Wilson and the girl met in the parking lot of an Austin coffee shop before going to a hotel and having sex, according to an arrest affidavit. The girl told investigators that Wilson paid her $500 when the two parted, the document stated.

Wilson's defense attorney, F. Andino Reynal of Houston, previously told the American-Statesman that Wilson believed the girl was a consenting adult. SugarDaddyMeet.com requires users to check a box stating they are at least 18 before they can register for an account. The age of consent in Texas is 17.

Wilson, a University of Texas law school dropout, came into the national spotlight after his company, Defense Distributed, publicized online instructions for making untraceable plastic guns with a 3D printer. In August 2018, a federal judge ruled in favor of 19 states and Washington, D.C., and blocked the company from posting the instructions, which were available to download for free. The company responded by selling them at a name-your-own price.

A grand jury indicted Wilson in January on charges of sexual assault, indecency with a child by contact and indecency with a child by exposure. The injury to a child offense for which he pleaded guilty is a third-degree felony, less severe than the indicted charges.

Wilson was arrested in Taipei, Taiwan, after he traveled abroad. He resigned from Defense Distributed shortly after his arrest.