A Madison man was sentenced to six years in prison Wednesday after pleading guilty to taking part in an armed robbery at the Red Pepperoni in March.

William Zachary Barnes, 20, will also spend four years on probation according to a plea agreement signed with prosecutors.

Barnes pleaded guilty to robbery, a Class B felony. In March, two men ran into the Red Pepperoni with masks on and wielding knives, demanding money from the cash register while two other men provided a lookout, according to police.

According to the plea agreement, Barnes will also pay $450 in restitution from the case.

Jeremy D. Howard, 29, Bryant A. Bladen, 18, and Christian Williams, 18, are codefendants in the case who still have pending charges.