BANGOR, Maine — A Gardiner man who admitted to robbing a pharmacy in his hometown last summer was sentenced Friday in U.S. District Court to four years and three months in federal prison.

Jesse N. Mansir, 31, pleaded guilty in October to one count of interference with commerce by robbery.

In addition to prison time, Mansir was sentenced to three years of supervised release, according to the U.S. attorney’s office.

Mansir went in the Rite Aid in Gardiner on Aug. 21, approached the pharmacy counter and handed a threatening note to a pharmacy technician, according to court documents. He told the technician that he had a gun and he concealed one of his hands. The pharmacist gave Mansir two bottles of oxycodone and Mansir fled.

Law enforcement officers found Mansir that evening with the aid of a police dog and recovered one of the stolen oxycodone bottles. Mansir admitted that he had committed the robbery to feed his opiate addiction, according to the prosecution version of events to which he pleaded guilty. He told investigators he had not carried a gun for the robbery but told the pharmacy technician that he had a gun. Mansir told police that he took the pills to the woods and spent the day getting high.

Mansir faced up to 20 years in prison and a fine of up to $250,000.

The investigation was conducted by the Gardiner Police Department, Maine State Police, Kennebec County Sheriff’s Office and FBI, according to the U.S. attorney’s office.