An inmate in a central California prison bashed a convicted child molester over the head with a cane last week, inflicting an injury so severe that it later killed him – cutting the man’s life-sentence short, officials said Monday.

MISSISSIPPI EX-CORRECTIONAL OFFICER WHO KICKED, PUNCHED, STOMPED ON INMATE GETS PRISON TIME

David Bobb, 48, was serving a life sentence with the possibility of parole at the California Substance Abuse Treatment Facility and State Prison in Corcoran. He was convicted in San Diego County for aggravated sexual assault of a child under 14 years old.

He and another unidentified inmate were rushed to the hospital with multiple head wounds Thursday after a third prisoner -- Jonathan Watson, 41, attacked them both with a walking cane, Fresno’s KSEE/KGPE reported.

Bobb died en route to the hospital, the California Department of Corrections and Rehabilitation said. The department launched an investigation into the incident. The second man who was attacked remained in critical condition as of Monday.

Watson had been transferred to Corcoran State Prison from Humboldt County in September 2009. He was serving time for first-degree murder and intentionally discharging a firearm causing great bodily injury or death.

CLICK HERE FOR THE ALL-NEW FOXBUSINESS.COM

The Associated Press found in a 2015 analysis that male sex offenders were being killed at a rate double that of other inmates in California’s prison population, often because they are targeted by other inmates for their crimes against children.

The prison houses more than 5,400 inmates and specializes in substance abuse treatment.

The Associated Press contributed to this report.