Former Republican Oklahoma state Sen. Ralph Shortley was sentenced to 15 years in prison Monday on child sex trafficking charges after police found him in a motel room with a 17-year-old boy in March 2017. He’ll be on probation for another decade after he gets out of prison.

Shortley, 36, resigned from the state Senate after two terms just weeks after police found him in the local Super 8 motel with the teenager, and his wife divorced him earlier this year. He faced life in prison and a fine of up to $250,000, according to KJRH Tulsa.

“In a difficult case like this, where he was looking at life in prison, and the government wanted between 25 and 30 years, we were hoping the judge would show some leniency, and he did,” Ed Blau, Shortley’s attorney said at a press conference after the ruling on Monday. “This is a tragic case all the way around.”

According to the victim's statements to the FBI, Shortley and the teenage boy smoked marijuana, got undressed, and had just started fooling around when officers knocked on the door.

According to an affidavit obtained by the Washington Post in November, the teenage boy had told Shortley that he needed money for spring break.

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

“Yes,” the teen responded.

While the age of consent in Oklahoma is 16, Shortley offering to pay the teenager for “sexual stuff” took the crime to a new level. And the crime became a federal issue after he transported a minor for prostitution when the two met in a motel in a neighboring town, News OK reported.

The FBI found that Shortley had used fake names for years in online posts to receive child pornography and seek sexual encounters with boys.

“The younger the better,” he wrote on Craigslist, according to News OK, adding, “Discretion is a must.”

Shortley pleaded guilty in November in exchange for prosecutors dropping all child pornography charges.