The man admitted his guilt to deputies when they confronted him and told them he had a problem, said Assistant Washington County State's Attorney Gina Cirincion.
Washington County Circuit Judge John H. McDowell delayed sentencing pending a pre-sentence investigation and an opportunity to hear from the victim and her mother.
McDowell denied the man's request for work-release from the Washington County Detention Center.
In the other case, a 51-year-old Clear Spring man pleaded guilty to third-degree sex offense. In exchange for his plea, charges of child sexual abuse, second-degree assault, fourth-degree sex offense and contributing to the condition of a minor were dismissed.
McDowell sentenced the man to eight years in prison but suspended all but 15 months, which will be served in the Washington County Detention Center.
He also must register as a sex offender, McDowell ordered.
McDowell ordered jail time despite a tearful plea from the man's daughter to let him remain free.
"I just would like to say I want to be a family again and do not want to see him go to jail," the woman told McDowell. "I do not want to see my mother torn apart by this."
McDowell read a letter from the girl expressing her desire to see her "pappy" again.
The man walked into his 12-year-old stepgranddaughter's bedroom April 19 and touched the girl underneath her sheets. He was caught by the girl's mother, Cirincion said.
The man has no prior criminal record and family members told police he never has done anything like that before.
The man said nothing during the proceeding, but his attorney, Steve Kessell, said his client was deeply sorry for his actions.
"Every indication is that this was an isolated incident," he said. "Why did it happen? I don't know. I don't know that we'll ever know."
McDowell gave the man two years probation when he gets out of jail and ordered him to seek counseling. He also ordered him to have no contact with the girl until her therapist signs off on it.
"It's going to affect her in some way. It probably already has," he said.