A Bensalem man pleaded guilty Friday to fatally beating a chiropractor he blamed for pain in his jaw and attacking a detective who went to interview him about the assault.

Joseph O’Boyle, 23, entered a general plea to criminal homicide, admitting that he killed James Sowa, but disputing the degree of murder that applies in the case. He also pleaded guilty to aggravated assault, resisting arrest, and simple assault for punching Bensalem Township Detective David Nieves.

» READ MORE: A Bensalem chiropractor was killed by a disgruntled patient who blamed him for jaw pain, DA says

O’Boyle confronted Sowa, 64, at his office in November 2020 and struck him three times in the head with a blunt object, according to a grand jury presentment filed in the case. As Sowa lay prone, O’Boyle hit him several times in his jaw in an assault that lasted less than a minute, prosecutors said.

The confrontation had been brewing, O’Boyle’s parents told the grand jury. O’Boyle had long suffered from jaw pain, and told his parents that Sowa’s treatment in September had done little to relieve it, and may even have made it worse. At one point, the O’Boyles said, their son threatened to sue Sowa.

After O’Boyle attacked Sowa, he fled in a Nissan Altima, according to prosecutors. A few hours later, Sowa’s son, Alex, worried that he hadn’t heard from his father, went to the office and found the chiropractor on the floor, unresponsive. Medics pronounced him dead at the scene.

Surveillance footage from nearby homes recorded the Altima leaving Sowa’s office, and detectives discovered the vehicle was registered to O’Boyle’s mother. When police went to the family’s home to serve a search warrant, O’Boyle grew agitated and punched Nieves repeatedly in the head.

O’Boyle was charged in that assault, but denied any involvement in Sowa’s death, an assertion his parents supported.

Months later, a grand jury was impaneled to investigate the slaying. During testimony, O’Boyle’s parents revealed that a week after Sowa’s death, O’Boyle admitted to them that he killed the chiropractor.

And a friend of O’Boyle’s told the grand jury that before the attack, O’Boyle told him on Snapchat that he was fascinated by Cosmo DiNardo, a fellow Bensalem native who lured four teens to a farm in Solebury Township in 2017 and killed them.

Prosecutors, led by Assistant District Attorney Megan Hunsicker, say O’Boyle’s crime should be classified as first- or second-degree murder — both of which come with mandatory life sentences — because he killed Sowa during the commission of a burglary.

O’Boyle’s attorney, Joseph Haag, is expected to argue at a June 6 hearing that the crime should be considered third-degree murder because he said O’Boyle did not break into the chiropractor’s office, as prosecutors allege.

.