AUGUSTA — Two men have received identical prison terms for their roles in robbing a Rite Aid pharmacy in Waterville last August.

Lance C. Vashon, 35, of Benton, and Nicholas Hunter, 34, of Waterville, were sentenced last week in Kennebec County Superior Court to seven years in prison, with all but 30 months suspended, and three years of probation.

A co-defendant, Nicholas Hunter’s son Carl A. Hunter, had pleaded guilty in the same court in December and was sentenced to seven years in prison. Carl Hunter, now 19, had been on probation at the time of the pharmacy robbery on Aug. 21, 2012.

Conditions of probation ban Vashon from contact with his co-defendants and from returning to the pharmacy.

Vashon also pleaded guilty to two other theft charges from May 25 and 28 in Waterville, and received 30-day concurrent sentences for each.

A condition of Nicholas Hunter’s probation bans him from contact with Lance Vashon. Waterville police said Nicholas Hunter made a call to police to try to divert them to another location while the robbery was taking place.