Two men have been arrested in connection with separate attacks on Massachusetts state troopers during traffic stops days apart, authorities said Tuesday. 

The most recent attack occurred July 7 in the Boston suburb of Tewksbury on Interstate 495, the state police said. 

A trooper stopped Hernan Aybar Romero, 24, and discovered he had four arrest warrants for alleged trafficking in heroin, morphine, opium and fentanyl. When Romero got out of his vehicle, he assaulted the trooper as he was being put in handcuffs, authorities said. 

He got back into the vehicle and fled, police said. The trooper was treated at a local hospital and released. 

COPS GONE WILD? SERIES OF SEX ROMP CLAIMS DOGS LAW ENFORCEMENT AS 'DEFUND' MOVEMENT MAY ADD FUEL TO FIRE

Massachusetts State Police attacks

Colin James Webb, 19, is accused of attacking a Massachusetts state trooper during a July 5 traffic stop.  (Massachusetts State Police)

Authorities caught up with Romero on Tuesday and took him into custody. He faces a slew of charges, including resisting arrest, assault and battery of a police officer, malicious destruction of property over $1,200 and assault with a dangerous weapon. 

The attack came two days after a trooper approached a motorcyclist July 5 on an Interstate 95 off-ramp stop light in Wakefield for erratic operation. The motorcyclist was identified as 19-year-old Colin James Webb. 

The trooper repeatedly asked Webb to turn off the bike, which he allegedly refused to do. Police dashcam video appears to show Webb attempting to drive toward the trooper, who was standing in front of the handlebars and front wheel of the sport-style motorcycle. 

Webb was eventually able to speed away from the trooper, who was pushed into the intersection by the advancing bike before managing to free himself from it, narrowly avoiding being hit by a passing pickup truck. 

Police attack during traffic stop

A Massachusetts state trooper tried to stop a motorcyclist during a traffic stop attack, police said. Two men have been arrested for alleged attacks on troopers days apart, authorities said.  (Massachusetts State Police)

Webb was arrested July 7 and faces charges of assault and battery of a police officer, negligent operation of a motor vehicle and assault with a dangerous weapon, among others. 

CLICK HERE TO GET THE FOX NEWS APP

"These incidents were brazen, and deliberately violent assaults perpetrated by motivated offenders on public servants who were engaged in their duties to protect our roads, our communities, our citizens, and our visitors," said Massachusetts State Police Supt. Col. John Mawn Jr. "We work very hard to ensure that violence directed against any victim – police officer or civilian – is answered with a swift and thorough response, and that was exactly what was done in these two investigations."