Logan L. Killman, from Sarcoxie, Mo., was arrested Monday after the school's resource officer was alerted that Killman was trying to gain entry into the school to drop off an item to the girl, said Hyde Park Police Lt. Robert Benson.
Officers immediately began an investigation in which Killman told investigators he met the girl online and came to New York to live with her.
At the conclusion of the investigation, Killman was charged with felony promoting a sexual act by a child, felony possessing sexual performance by a child and endangering the welfare of a child, Benson said.
Killman is being held at the Dutchess County Jail on $40,000 cash or $80,000 bail bond.
He is scheduled to appear in court on Nov. 14.
Click here to follow Daily Voice Northwest Dutchess and receive free news updates.