PORTLAND, Maine — A former Bangor man was sentenced to serve seven years in prison for robbing a Yarmouth Rite Aid in March and then leading police on a high-speed chase.

Dylan Libby, 21, who police said in March had just moved to North Yarmouth from Bangor, was indicted by a Cumberland County grand jury in May for the Class B crimes of robbery, aggressive eluding an officer and aggravated assault for “recklessly causing bodily injury to Madeline Damon [his girlfriend] with use of a dangerous weapon or motor vehicle.”

According to court documents, police responded to an alarm at Rite Aid on Route 1 and encountered Libby exiting the store. Yarmouth police Officer Michael Pierce wrote in an affidavit that he drew a handgun on Libby and 18-year-old Damon of Bangor. He ordered them to raise their hands, but Libby drove off with Damon in the car, striking a police car and leading officers on chase on Interstate 295.

Pierce pursued Libby northbound at speeds of more than 122 mph before discovering Libby’s Mitsubishi Lancer crashed just past the Mallett Drive exit in Freeport. Damon appeared to be severely injured, Pierce wrote.

Following a brief foot pursuit, officers took Libby into custody. They found a pill bottle nearby and also another pill bottle in the vehicle.

Police say Libby handed the Rite Aid pharmacist a note reading, “I need 2 full bottles of perk 30s [Percocet 30 milligrams]. I have weapons and do not want to cause a scene.”

The pharmacist complied but tripped an alarm.

Yarmouth police Lt. Dean Perry told the Bangor Daily News in March that even though Libby’s note indicated he had a weapon, he was not armed.

According to emails to the court from Libby’s family members, he is “a heavy addict” who has been “in and out of jail” and sober homes.

Libby pleaded guilty on Friday and was sentenced in Portland Superior Court to serve seven years with three years probation.