OKLAHOMA CITY (AP) — A former Oklahoma state senator accused of engaging in child prostitution and pornography pleaded guilty Thursday to a federal charge of child sex trafficking.

Former two-term Republican state Sen. Ralph Shortey entered his plea before U.S. District Judge Timothy DeGiusti in exchange for federal prosecutors dropping three child pornography charges against him.

Shortey, dressed in a blue suit and wearing a GPS tracking device on his left ankle, said nothing when DeGiusti ordered him back into federal custody pending sentencing. Shortey removed his jacket and tie, and federal marshals handcuffed him and led him away.

Shortey faces between 10 years and life in prison and a fine of up to $250,000 for child sex trafficking. The judge did not set a sentencing date.

Shortey's defense attorney, Ed Blau, released a statement after the hearing that said the former lawmaker changed his plea because he wanted "to take full responsibility for his actions and move past this embarrassing and difficult time." Shortey previously pleaded not guilty to the federal charges.

The 35-year-old Shortey resigned in March after he was arrested on state charges of engaging in child prostitution and transporting a minor for prostitution.

Police in the Oklahoma City suburb of Moore arrested Shortey, a married father of four, in March after they found him with a 17-year-old boy in a motel room and accused him of hiring the boy for sex. Acting on a tip from the teenager's father, police went to the motel and smelled marijuana coming from a room where they found Shortey and the boy.

A police report indicated a search of the teen's tablet computer uncovered a series of sexually explicit exchanges in which Shortey referred to the teen as "baby boy" and offered him cash in exchange for "sexual stuff."

The conversation had started with the teen messaging Shortey that he needed "money for spring break," police wrote. Officers also found lotion and an open box of condoms inside backpacks in the room.

The FBI became involved in the case shortly after Shortey's arrest and conducted a search of Shortey's Oklahoma City home.

A federal grand jury returned a four-count indictment against Shortey in September. The indictment alleged that Shortey produced child pornography in 2016 and 2017 and used his smartphone to send videos involving young boys and a young girl in 2013.

The indictment also accused Shortey of child sex trafficking for allegedly soliciting a minor to engage in a commercial sex act on March 8 and 9 of this year — accusations that involved him and the teen at the motel, and that led to Shortey's arrest and the state charges. Those charges against Shortey were dismissed following the federal indictment.

Shortey built a name for himself in the Oklahoma Senate by pushing bills targeting those living in the U.S. illegally and expanding gun rights.

Before his arrest, Shortey was perhaps best known for introducing a bill in 2012 that would have banned the use of aborted human fetuses in food — a measure that drew widespread ridicule and was never granted a hearing in a Senate committee.