HAVERHILL (CBS) – A man police described as “dangerous and potentially armed” was taken into custody Wednesday afternoon, four hours after he ran from officers following a traffic stop.

Elias Sudler, 27, was the passenger of a 1996 Chevrolet pickup truck. Police tried to stop the driver for an inspection sticker violation, but the 35-year-old operator did not pull over and officers began a pursuit.

READ MORE: 2 Boston Police Officers, Child Hospitalized After Fight On School Bus

Elias Sudler. (Image Credit: Massachusetts State Police)

The driver stopped at a CVS on Route 97 and was arrested. Police say Sudler tried to grab a backpack that was in the truck but ran off without it. A gun was found inside the backpack.

State Police did not know if Sudler had any additional weapons. He has an “extensive” criminal record.

A State Police helicopter, K-9 units, and other state and local police officers searched the area. Just before 2:30 p.m., police say a K-9 “engaged” Sudler and he was taken into custody.

READ MORE: Expert Brought In By I-Team Now Helping Saugus Determine Source Of Fly Infestation

The hours-long search kept school children inside on what was supposed to be an early release day due to the extreme heat.

Elias Sudler is brought to an ambulance after a K-9 located him in the woods. (WBZ-TV)

Sudler was taken by stretcher to a nearby ambulance. He was taken to an area hospital, then booked. He was charged with: possession of a firearm without an FID, possession of ammunition without an FID, resisting arrest, possession of a firearm in a felony, carrying a loaded firearm, arrestee furnishing false name/Social security number, assault & battery on police officer and conspiracy to commit a crime.

In addition to charges from Wednesday, Sudler was wanted on four felony warrants for stalking, kidnapping and assault and battery, carjacking, and witness intimidation.

According to the Suffolk County District Attorney, Sudler was indicted last month for stalking and sexually assaulting a former partner. He remained at large and has yet to be arraigned.

MORE NEWS: Boston Nightlife Venue Will Require COVID Vaccine Card Proof Or Masks Due To Delta Variant

The driver, Ishaq Abdul-Shafi, a 35-year-old Quincy man, was also arrested and charged with failure to stop for police, negligent operation, conspiracy to commit a crime, and not having an inspection sticker.