PITTSFIELD — A Wilbraham man who was caught with more than two dozen bags of heroin during a 2015 traffic stop has been sentenced to 21/2 years in jail.

Devon James Jr., 26, admitted to having the drugs April 18 when he was stopped in Pittsfield by police who had received a tip that he may be involved in drug distribution and that his driver's license had been suspended.

He was pulled over about 2:21 p.m. at Burbank and First streets.

Police searched the vehicle after spotting four empty wax bags — the type commonly used to package heroin — on the floor in front of the driver's seat.

That search recovered 31 bags of heroin, stamped with the words "Blue Magic," with a street value of about $310, according to court records.

He pleaded guilty in Berkshire Superior Court on Tuesday to a first offense of possession of heroin with intent to distribute and a charge of operating a motor vehicle with a suspended license.

James' heroin charge was originally considered a second offense, but it was reduced to a first as part of an agreed-upon sentencing recommendation between Assistant Berkshire District Attorney Richard Locke and James' attorney Joe A. Smith III.

Judge John Agostini ordered him to serve his sentence at the Hampden County House of Correction in Ludlow and was given credit for 168 days of time already served in custody.

Contact Bob Dunn at 413-496-6249.