Franklin County Superior Court Justice Michaela Murphy approved a two-year deferred sentence agreement for Ashley M. Lake, 28, formerly of Industry. She also ordered her to serve two years of probation after she completes the agreement.

If she successfully completes it, she will be able to withdraw her pleas to the felony charges and plead to two misdemeanor charges, which each carry up to 364 days in jail. The jail sentence would be suspended.

If she is not successful, she faces up to five years in prison on each charge, Murphy said.

Lake pleaded not guilty to robbery and unlawful possession of oxycodone in February. Under the plea agreement, the robbery charge was dismissed.

Lake is a co-defendant in the case with Timothy Campbell, 33, of Chesterville, who was also indicted on the robbery and oxycodone charges in January.

Murphy said a letter from the Maine Family Drug Court in Lewiston said Lake has been doing well in a drug treatment program. A condition of the agreement is that she continue under the intense supervision of her caretakers and continue counseling.

Lake told the court she is off opiates and methadone.

If Lake’s case went to trial, the court would have heard from a Walmart pharmacist that at about 7:30 p.m. Sept. 21, a woman handed a note demanding 30-milligram pills of oxycodone, Assistant District Attorney James Andrews told the court.

Farmington police previously said she told the pharmacist she had a gun but no gun was found when she was located.

Testimony would show there was no gun, Andrews said.

The pharmacist would testify that he handed over three bottles of 30-milligram oxycodone pills, he said.

A Farmington detective would testify that surveillance video showed Lake leaving the store and two people running away toward nearby Colonial Valley Motel. A tracking dog also tracked the two to the neighboring motel.

Officers knocked on the doors of a room there and they found Lake and Campbell, Detective Marc Bowering would testify, Andrews said.

He would testify that Miranda rights were read and Lake was interviewed at the Farmington Police Station. She admitted to presenting the note to the pharmacist and returning to the motel room, Andrews said. She also told police she and Campbell had been consuming drugs prior to going to Walmart, he said.