An 18-year-old suspect in a gay bar attack in Massachusetts shot himself over the weekend in a shootout with Arkansas police officers.

Bristol District Attorney Paul Walsh Jr. said Jacob D. Robida, who was wanted on suspicion of attacking several members of the New Bedford gay bar, Puzzles last week, turned a gun on himself after shooting and killing a lone police officer during a routine traffic stop on Saturday.

Early on Saturday afternoon, Mr Robida was stopped for a traffic violation by Officer Jim Sell in Missouri. He shot Mr Sell, 56, with a handgun while the officer was inspecting his driver’s licence, according to the Boston Herald.

Bill Sadler, a spokesman for Arkansas State Police said the suspect sped off in his car, and police officers in nearby towns tried several times to stop him by firing and trying to block the road with their cars.

Police officers set out spike strips on the road, which punctured two of the car’s tyres. He drove into the town of Norfork, losing control of his car and crashing into two parked cars.

Police only realised this was the same teenager wanted for the Massachusetts attack after pulling him over. Officials also believe that Mr Robida killed a 33-year-old woman from West Virginia, Jennifer Rena Bailey, apparently an acquaintance he had picked up after the attacks in Massachusetts.

Early last Thursday morning, Mr Robida, a high school dropout from New Bedford, walked into Puzzles Lounge in that town, ordered a drink and asked the bartender if Puzzles was a gay bar, according to previous reports on 247Gay.com.

When told that it was a gay bar, he reportedly attacked two men playing pool and another man leaving the restroom.

New Bedford police said that the attacker struck a bar patron in the head with a hatchet and hit a second patron when he tried to come to the aid of the first victim. The third victim was shot. Mr Robida fled, leaving behind the hatchet and a machete he had not used.

The police, who said the suspect had once attended a police academy for troubled teens, reported that they found neo-Nazi symbols and anti-Semitic and racist writings at Mr Robida’s home.

New Bedford’s mayor Scott Lang paid a visit to Puzzles on Saturday night to tell patrons that Mr Robida had been caught in Arkansas and was in the hospital. Several patrons expressed relief, including Robert Perry, one of the victims, who showed up at the bar after his release from the hospital with a black eye a 5-inch gash on his face and a bullet hole in his back, according to the Associated Press