Former Oklahoma state Sen. Ralph Shortey has reached a plea deal with federal prosecutors months after investigators uncovered a secret life that they say involved child pornography and a rendezvous with a 17-year-old boy he had met through Craigslist’s personal ads.

Shortey, a Republican who resigned last spring amid allegations that he had solicited sex from the teen, will plead guilty to a child sex trafficking charge, his attorney, Ed Blau, said. Prosecutors will drop three child pornography charges as part of the plea deal.

“After looking at all the evidence and case law and statues and everything else, we just felt that this would give him the best opportunity to come out with the best outcome possible,” Blau told The Washington Post. “It would’ve been an extraordinarily difficult case to win a trial.”

Had Shortey gone to trial and lost, he would’ve been looking at a 30-year prison sentence at the very least, Blau said. The sex trafficking charge is punishable by at least 10 years in prison. Federal law requires defendants to serve at least 75 percent of their sentence. In Shortey’s case, that would be 8½ years, but a judge will ultimately decide on what his sentence would be.

A spokesman for the U.S. attorney’s office in Oklahoma City said he can’t comment on the plea agreement but pointed out that Shortey is scheduled to appear in court Nov. 30 for a plea hearing.

Shortey, who represented a portion of Oklahoma City, was first charged in Cleveland County in March, after police officers found him and the underage teenager in a motel room. Authorities said the two had been talking since they met on Craigslist the year before and later agreed to go to a Super 8 motel in Moore, Oklahoma, just south of Oklahoma City.

Investigators also found messages the two had exchanged on a messaging app called Kik.

According to an affidavit, the teen told Shortey that he needed money for spring break, and the two talked about meeting for sex.

“I don’t really have any legitimate things I need help with right now,” Shortey wrote, the affidavit said. “Would you be interested in sex stuff.”

“Yes,” the teen responded.

Shortey was charged with engaging in child prostitution, transporting a minor for prostitution and engaging in prostitution within 1,000 feet of a church. The motel was near First Christian Church. Those charges were dismissed in September, when state officials turned over the case to federal prosecutors. Shortey was indicted in federal court on child pornography and sex trafficking charges that same month.

Blau said a double-jeopardy statute in Oklahoma does not allow someone to be prosecuted in federal and state courts at the same time for the same crimes.

According to a federal indictment, Shortey had been using the email addresses and since 2010. In 2012, he created Craigslist and Facebook accounts using the AOL email address and used false names such as Brian Tilley and Jamie Tilley.

Shortey posted several ads on Craigslist in 2016, the indictment said. He asked people to message him on Kik, where he uses the username “Brinokc4u.” He also used the AOL address and his smartphone to send sexually explicit videos of young girls and boys, authorities said.

Shortey and the teen began talking on Kik in March 2016. A year later, on March 9, he picked up the teen from his home, and the two drove to the motel. Less than an hour later, the teen’s father called police and told them that his son had been seen going into a motel room with a man, according to the indictment.

The Oklahoman reported that the teen’s girlfriend saw Shortey pick him up. She then followed them to the motel and alerted the teen’s father.

Authorities found an open box of condoms and a laptop computer inside the room.

The explosive allegations prompted Republican leaders in Oklahoma, including Gov. Mary Fallin, R, to call for the two-term senator’s resignation. Shortey did so shortly afterward.

Shortey was first elected to the Oklahoma Senate in 2010. His Senate biography, which is still online, describes him as a “longtime political volunteer” who worked in the oil and gas industry as a production consultant before entering public office.

He is married to his “high school sweetheart” and attended Heartland Baptist Bible College in Oklahoma City, his biography said.

Blau said Shortey and his wife are still together. They have four children.

Shortey, an early supporter of President Trump, is known for his strong stance against illegal immigration and gun control. He also routinely voted in favor of bills targeting members of the LGBT community, the AP reported.

Recently, he proposed a bill that would ban sanctuary cities in Oklahoma. Senate Bill 573 was introduced last month, and Shortey’s name was removed as author last week.

In 2012, he stirred controversy by authoring an ill-fated bill to prohibit “the manufacture or sale of food products which use aborted human fetuses.”

Follow the Bangor Daily News on Facebook for the latest Maine news.