An Old Orchard Beach man was sentenced Tuesday to nine years in prison after he pleaded guilty to robbing a Rite Aid pharmacy in Old Orchard Beach in February.

U.S. Attorney Thomas Delahanty II said Billy Schildroth, 37, was sentenced to nine years in prison and three years of supervised released by U.S. District Judge Nancy Torresen.

According to court records, Kyle Desmarais drove Schildroth to the pharmacy on Feb. 13. Schildroth put a hand inside his coat and told the pharmacist that he had a gun and five bullets. He warned the pharmacist not to call police or he would shoot the pharmacist in the face.

Judge Torresen said his actions posed a danger to the pharmacist and the community. She also noted his criminal record, which includes a residential burglary and two drug trafficking convictions.

Demarais was sentenced in October to 2½ years in prison for aiding and abetting a pharmacy robbery.