A man who faces trial next week on rape and sodomy charges involving two young girls pleaded guilty Wednesday to lesser charges that will send him to prison.

Michael James Huddleston, 32, pleaded guilty in Ellis County District Court to attempted aggravated sexual battery and aggravated battery. A count of aggravated criminal sodomy was dropped in the plea agreement.

Although presumptive sentences for the charges are probation, the plea agreement stipulates Huddleston will go to prison with an anticipated sentence of 39 months — 27 months for the attempted sexual battery charge and 12 for the aggravated battery — however, that could change depending on the pre-sentence investigation report.

Sentencing is tentatively set for 3 p.m. Dec. 3.

Restitution for counseling for the victims is a possibility but has not yet been requested.

Huddleston was originally charged June 5, 2017, with rape of a 9-year-old girl and rape and aggravated criminal sodomy of a 7-year-old girl, according to court documents. Both incidents allegedly occurred in November 2016. All three charges carry a life sentence on conviction.

Huddleston has been in custody in the Ellis County Jail since his June arrest.