The veteran California police sergeant who was gunned down as he charged into a crowded bar to stop the Thousand Oaks massacre was killed by friendly fire, according to a new report.

Autopsy results revealed that Sgt. Ron Helus was struck by six bullets inside the Borderline Bar and Grill — five fired by the gunman, Ian David Long, and one by a California Highway Patrol officer, local station KTLA 5 reported.

The shots fired by the gunman “caused serious injuries but potentially survivable injuries,” chief medical examiner Chris R. Young told the outlet.

But the sixth bullet — which struck Helus in the heart — was recovered during surgery at the hospital after the shooting. FBI analysis found that bullet to be a rifle round fired by a Highway Patrol officer who had gone into the bar with Helus.

“This is sad news and a tragedy, but ultimately this was the most severe injury sustained,” Young said.

“We know that Ventura County Sheriff’s Sgt. Ron Helus and a CHP officer bravely entered the bar together, engaged the suspect who was lying in wait before officers arrived,” L.D. Maples, a chief with the California Highway Patrol’s Coastal Division, said in a statement issued to the station. “While Sgt. Helus and the officer’s actions prevented the suspect from killing more people, tragically during the fierce but brief firefight that ensued, a round fired by our officer toward the suspect did strike Sgt. Helus.”

Twelve people died in the massacre at the popular college bar, including a US Navy vet, a Pepperdine student, the bar’s bouncer and one of the on-duty busboys and food runners.

There’s no evidence that any of the other victims were struck by officers’ gunfire, according to the report.

“It is important to remember that the horrific circumstances at the Borderline Bar and Grill on that Wednesday night, exactly one month ago today, were caused by the evil action of one individual: the man who murdered 12 people and injured 22 others,” Ventura County Sheriff Bill Ayub said at a Friday news conference, according to the station. “He alone created the violence and he alone bears the responsibility for his course of action.”

Long died of an apparently self-inflicted gunshot wound.