LAWRENCE – A Beverly man about to go on trial for robbing two people during a firearms sale sting set up by the FBI in Lynn, opted instead to plead guilty, receiving 10 years in state prison to be followed by a five-year probationary term.Nelson E. Sanchez, 19, of 5 Folly Pond Road, Beverly, pleaded guilty Thursday morning in Lawrence Superior Court to armed robbery and using a firearm in the commission of a felony before Judge Leila R. Kern.The judge followed the recommended sentence proposed by Assistant District Attorney A.J. Camelio and defense lawyer Jon Taylor.The charges concerned a “setup” in Lynn involving two confidential informants who arranged to purchase two guns, a .45 caliber firearm and a .40 caliber firearm for $2,400.On March 1 at about 12:30 p.m., Sanchez, along with his alleged accomplice, Christopher Guiterrez, 22, of Lynn, met the informants, who were wired, in an alleyway on Lafayette Park in Lynn. Before the transaction was completed, Sanchez demanded they turn over the money and ripped a gold chain from the neck of one of the informants before fleeing from the scene. Police arrested them later that day.The guns were recovered along with the gold chain, authorities said.The entire incident was videotaped and recorded by FBI authorities.A third alleged participant, Donald Oliver, Jr., 22, of Lynn, is accused of arranging the gun sale.Gutierrez and Oliver remain held on bail awaiting trial on the case.The judge credited Sanchez the 322 days he spent in jail awaiting trial.