A Palmyra man has been charged with second-degree attempted rape after allegedly attempting to lure what he thought was a 14-year-old — actually a Canandaigua police officer — into meeting him for sex.

Robert Dickinson, 27, was charged Jan. 10 by the Canandaigua Police Department. According to police, he used social media to lure what he thought was the underage girl to meet him for sexual contact. It was actually an undercover detective with the Canandaigua department.

Dickinson was held in the Ontario County Jail until arraignment.