BARRE — A Montpelier man has been sentenced to time served and three years on probation for his role in an attempted assault and robbery at Dunkin Donuts in Berlin in 2012.

Curt E. Duford, 28, pleaded guilty to felony attempted assault and robbery and misdemeanor petit larceny Thursday in Washington County criminal court in Barre. He was sentenced to 60 to 61 days in jail, with credit for 61 days, for the larceny conviction and given a three-year deferred sentence for the attempted assault and robbery.

With a deferred sentence, Duford will be on probation for three years, which if he completes successfully, the conviction for attempted assault and robbery will come off his record. If he violates his probation, Duford can be brought to court to face the maximum sentence for the conviction, which is 10 years.

According to the police affidavit, Duford and Emma L. Valenzi, 24, also of Montpelier, pulled up to the drive-through window at about 2 p.m. on Feb. 23 and demanded cash while brandishing what looked like a handgun. The employee there backed away from the window, and the pair drove away without getting any cash.

Dunkin Donuts employees gave police a description of the vehicle the two were driving along with its license plate number. During the investigation, police learned the plate had been stolen from another vehicle about half an hour earlier in Barre.

Later that day Vermont State Police found and stopped the vehicle used in the robbery attempt, according to the affidavit. Valenzi gave police permission to search the vehicle, and they found a plastic toy gun that had been recently painted black and the stolen Vermont license plate.

In court Thursday, State’s Attorney Tom Kelly was seeking a six-month prison term for Duford, but Duford’s attorney, David Kidney, argued for time served. Judge Thomas Zonay sided with Kidney, saying there did need to be a punishment for the crime but that Duford had already served that punishment.

Duford described himself as a terror at the time of the robbery attempt and attributed his actions to a heroin addiction. He told the court he has since become clean and is focusing on staying sober.

Valenzi pleaded guilty to felony accessory after the fact and no contest to misdemeanor petit larceny in September. She was sentenced Oct. 4 to four to five days, with credit for five days served, on the petit larceny conviction and given a three-year deferred sentence for the accessory conviction.