A man who worked as a substitute teacher and teacher's assistant at two Virginia elementary schools has been sentenced to more than 12 years in prison for trying to entice a child to engage in illegal sexual conduct.

The Justice Department said in a news release that 21-year-old Monis Irfan, of Springfield, was sentenced on Friday to 150 months in prison followed by 20 years of supervised release.

Irfan pleaded guilty in July to charges stemming from an undercover police investigation. Authorities say Irfan communicated online with a Fairfax County police detective posing as the father of a 7-year-old child, who was fictitious.

The Justice Department says Irfan repeatedly told the detective he wanted to have sex with the child. Irfan was arrested when he drove to meet the detective.