State police arrested 22-year-old Michael Cox on two counts of rape and endangering the welfare of a child.