ROME, N.Y. — A college graduate student from central New York has been sentenced to 10 years in federal prison for trying to arrange to have sex with children.

The U.S. Attorney’s Office says Julio Perez-Torres, of Rome in Oneida County, was also sentenced Friday in Alexandria, Virginia, to 20 years of supervised release. He pleaded guilty in January to attempted coercion and enticement of a minor to engage in unlawful sexual activity.

Prosecutors say Perez-Torres was a master’s degree candidate at American University in Washington, D.C., when he posted an online advertisement saying he was interested in sex with children. Authorities say an undercover police officer in Virginia’s Fairfax County replied to the ad by portraying himself as a father of two young children.

After weeks of communicating with the officer, Perez-Torres was arrested in Fairfax County in February 2016.