A Pennsylvania man who stored images of himself sexually abusing a girl on a computer tablet and then sold it at a flea market has been sentenced to more than 27 years in prison.

New Castle resident Donald Miller was sentenced Friday in federal court on a child pornography charge.

Prosecutors say Miller recorded himself sexually abusing an 8-year-old girl before saving the images on the tablet. A woman who bought the tablet from him at an Ohio flea market in late 2013 discovered the images and notified authorities.

The 43-year-old Miller had pleaded guilty before a federal judge in Pittsburgh. He also will be sentenced next week on state charges including child rape.