BRUNSWICK, Maine — A former Brunswick police officer charged with two counts of attempting to send obscene material to a 13-year-old girl will likely plead guilty to one count in exchange for federal prosecutors dismissing the second charge, his attorney said Wednesday.

Garrett Brosnan, 25, was arrested June 21 at the Brunswick police station by federal agents.

Prosecutors say the investigation of Brosnan began when the parents of a 13-year-old girl in Flagstaff, Arizona, reported on May 9 that in October 2015 their daughter had a five-day online conversation that was sexual in nature with a man who told her he was 19 years old.

In May, an agent with the U.S. Immigration and Customs Enforcement’s Homeland Security Investigations posed online as a 14-year-old girl and engaged in a conversation with a man identified as Brosnan, who allegedly sent the agent nude photos and requested similar photos from the agent, according to an affidavit.

Brosnan resigned from the police department on June 25, which his attorney, Michael A. Cunniff, said indicated he was accepting responsibility for his actions and was willing to accept the consequences.

On Friday, Magistrate Judge John H. Rich granted an unopposed motion by Cunniff to extend the time before Brosnan is required to be indicted, according to court documents.

According to the motion, the two parties have reached a plea agreement but need additional time to finalize it.

On Wednesday, Cunniff told the Bangor Daily News that he expects Brosnan to plead guilty to one count in exchange for the other count being dismissed. He expects the agreement to be finalized next week, with sentencing likely set for November or December.

“The anticipated agreement will acknowledge that [Brosnan] has accepted responsibility for his conduct,” he said. However, the judge can still consider the full range of charges when sentencing him.

If convicted of either charge, Brosnan faces up to 10 years in jail and a $250,000 fine.