NORTH ADAMS -- A Pittsfield man was sentenced to two-and-a half years in jail on Wednesday for assaulting two state troopers in Adams after a routine traffic stop last year.

According to police, Tyler Sumner, 19, of Hamlin Street, was found in possession of an unlicensed firearm and had to be subdued with pepper spray after attempting to fight off two troopers on Columbia Street on Oct. 23, 2013.

Sumner was found guilty of two counts of assault and battery on a police officer, carrying a loaded firearm without a license, possession of ammunition without a firearm identification card, and possession of a firearm without a firearm identification card.

Judge Michael Ripps' sentencing was in line with recommendations by the Berkshire District Attorney's Office and Sumner's attorney Michelle Mechta.

When Trooper Michael O'Brien began a pat-down search of Sumner outside the pulled-over car, he resisted, knocking down O'Brien into the road. Sumner then punched and pushed Trooper Dave McKearney, according to the police report.

After his arrest, police found a Colt .25 pistol containing one round on Sumner. He told police that he and another passenger were members of the Crips gang.

Sumner was one of three male passengers and two female passengers in the car. No other occupant was charged in the incident.

The vehicle was initially having when O'Brien suspected the driver wasn't licensed have passengers, according to a criminal complaint submitted by O'Brien. In Massachusetts, a junior licensed operator is prohibited from driving with passengers unless accompanied by somebody at least 21 years old.

The passengers had appeared nervous and were moving in a suspicious manner after being pulled over, O'Brien stated. They also told him they were headed to the North Adams Wal-Mart, which the officer stated he found suspicious because there is a Wal-Mart in Pittsfield, where the occupants lived.

O'Brien ran identifications and discovered Sumner was on probation for a previous assault with a firearm dating back to 2012. David Sumner, another rear passenger, faced an open charge of assault with a dangerous weapon, and Shaquille Danielle, the third rear passenger, faced three charges of theft with a firearm.

"I became concerned for my safety," O'Brien stated, based on the occupants' criminal history and movements inside the vehicle.

Mechta had argued in an earlier hearing that the search was unlawful.