BOULDER, Colo.—A man accused of emerging from a Colorado portable toilet covered in feces has pleaded guilty to two burglary counts and attempted unlawful sexual contact.

Luke Chrisco was arrested in 2011 after a woman at a yoga festival in Boulder noticed something moving in the tank of the portable toilet, then saw a feces-stained man emerge and run away. Police said he also was suspected of hiding in other bathrooms around Boulder to watch women use the toilet.

Chrisco had pleaded not guilty by reason of insanity to various charges in May but changed his plea Tuesday.

Chrisco could face up to six years in prison at a sentencing hearing set for Aug. 30.