LAWRENCE – A Lynn man police captured for selling various amounts of heroin to an undercover police officer during a five-month span beginning in 2005 will serve up to seven years in state prison.Jesus Castaneda, 22, who last lived at 11 Chase St., in Lynn, avoided a trial instead by plea bargaining his case Wednesday morning in Lawrence Superior Court.He confessed to a reduced charge of possession with the intent to distribute heroin as well as a second charge of possession with the intent to distribute heroin, two counts of distribution of heroin, possession with the intent to distribute cocaine, three counts of assault with a dangerous weapon and furnishing police with a false name upon arrest.He was sentenced to serve not less than four years and not more than seven years in state prison by Judge Richard E. Welch, III.The judge agreed to follow the recommended punishment offered by Assistant District Attorney Marcia H. Slingerland and defense lawyer Raymond D. Buso.Castaneda had been charged with trafficking over 28 grams of heroin on the first charge. His confession spared him a minimum mandatory punishment of seven years in state prison on that one charge.The charges stemmed from three drug deals with an undercover officer beginning in December of 2005 in Lynn.On Dec. 20, Castaneda sold two grams of heroin for $160 to an undercover officer at the Wendy’s parking lot on Boston Street.On Jan. 5, a finger, 10 grams of heroin, was transacted for $800 at the same location but was delivered by co-defendant, Angel DeJesus, 23, of Lynn.Then on May 23, both Castaneda and DeJesus delivered four fingers, 39-plus grams of heroin, for $3,200 in cash at the Wendy’s parking lot on Boston Street.At the close of the deal, Castaneda proceeded to the drive-through and ordered take-out.As Castaneda and DeJesus waited in the red Ford Explorer for their food, troopers moved in to arrest the men, but Castaneda accelerated the gas pedal and began to flee, smashing into another vehicle and colliding with a trooper’s car.He was finally stopped after slamming into another parked car in the parking lot.Police found the $3,500 in drug buy money in the car. A subsequent search of the vehicle revealed five twists of heroin, two bags of cocaine and $886 in cash on Castaneda.Castaneda told police his name was Luis Mendez at the time of his arrest and provided police with a license with that name.Authorities later learned his true name is Jesus Castaneda, also known as “Mexico.”DeJesus was also charged in connection with the case, but the heroin trafficking charge was tossed out during a preliminary trial motion in which Judge David A. Lowy agreed with defense lawyer Steven Judge that the presentation before the grand jury was insufficient to warrant the charge against his client.DeJesus plead guilty earlier this week to a second charge against him for distribution of heroin in connection with the case. He was handed a split term of 18 months in the House of Corrections, with all but 15 months suspended and placed on a year of probation by Judge Welch.Under the terms of his probationary period, DeJesus must remain employed and continue child support for his children.Castaneda has been in custody since his arrest in lieu of bail at the Middleton Jail and will receive credits toward his term of incarceration in state prison.