A former Brunswick police officer who pleaded guilty to sending obscene material to an underage girl was sentenced to a year and a day in federal prison Wednesday.

Garrett Brosnan, 25, was arrested in June. He was sentenced Wednesday in U.S. District Court in Portland.

Police started investigating in October 2015, when the parents of a 13-year-old girl in Arizona complained that someone had engaged in inappropriate online conversations with their daughter.

A Department of Homeland Security agent, posing as a 14-year-old girl, then began having conversations with Brosnan. He allegedly sent the agent pictures of his genitals.

In a sentencing memorandum, prosecutors said Brosnan repeatedly pushed the agent he thought was a 14-year-old girl to send him topless or nude photos.