A New Hampshire man who drove to Maine thinking he would meet a 13-year-old girl for sex but had actually arranged a meeting with police was sentenced Tuesday to serve more than three years in prison.

Chad Amodio, 43, of Milton, New Hampshire, was sentenced in U.S. District Court to serve 40 months in federal prison, followed by five years of supervised release, on a charge of interstate travel to have sex with a minor.

Amodio had pleaded guilty before Judge John Woodcock Jr. on Nov. 7.

“Beginning sometime in March of 2014, an actual 13-year-old female was having inappropriate sexual conversations with two adult men on a website intended for men and women to chat and exchange photographs,” said Assistant U.S. Attorney Andrew McCormack in a prosecution document filed with the court last year. “The police were alerted and took over the account of the actual 13-year-old girl.”

A Bangor detective used the girl’s online account to arrange a meeting with Amodio on May 1, 2014, while the girl’s mother was supposedly at work. When Amodio arrived, he was arrested, court records say.

“A search of (Amodio’s) vehicle revealed a bottle of vodka, a bottle of whiskey and a bottle of lubricant,” McCormack wrote in the prosecution document.