A man, who police say was in the country illegally, has pleaded guilty to two counts of rape of a child in Wilson County, according to authorities.

Edwin Velasquez Curuchiche, 42, was charged with raping a then 6-year-old twice after Lebanon police said he became acquaintances of a local family and fraudulently obtained a key to the home.

Curuchiche, from Guatamala, was sentenced to 25 years on each count, which will run consecutively for a total of 50 years, police said.

The sentence will be served concurrently with a 50-year federal sentence Curuchiche received for production of child pornography, which resulted from the same investigation.

Lebanon police located two video recordings dated Sept. 23, 2015, and Oct. 1, 2015, that prosecutors said showed Curuchiche sexually molesting the victim.

Neither video showed the face of the defendant or victim, but did show unique rings and shoes on the defendant and birthmarks, clothing and bedding consistent with the victim, according to the prosecution.

Curuchiche was accused of sneaking into the family’s home in both instances.

He was detained on Oct. 29, when officers found Curuchiche hiding under the victim's bed in the youth's bedroom.

The family had been at the store and the victim went to her bedroom to get a toy when they returned from the store, prosecutors said.

Curuchiche reached up to grab the victim and told her to be quiet, prosecutors said. The victim instead screamed and ran to her parents, who detained Curuchiche and called police. There were no signs of forced entry into the residence, prosecutors said.

Curuchiche was serving his federal sentence when he pleaded guilty to charges in Wilson County on Monday

Reach Andy Humbles at ahumbles@tennessean.com or 615-726-5939 and on Twitter @ AndyHumbles.