The number of police officers and federal agents who died in the line of duty has jumped this year, an increase largely attributable to a spike in car crashes and job-related illnesses, according to a new report.

The report, by the National Law Enforcement Officers Memorial Fund, comes as the nation approaches the anniversaries of July 2016 ambush killings that left eight officers dead in Dallas and Baton Rouge, fanning a furious national debate over anti-cop sentiment. The statistics were also released two days after the funeral of a New York police officer ambushed on July 5.

A Dallas police officer the day after five cops were shot to death in July 2016. LM Otero / AP file

None of those killings are included in the new report, which covers deaths in the first six months of 2017 and compares them to same period last year. The report documents three ambush killings in 2017, the same number as mid-year 2016.

In total, 65 law enforcement officers died in the line of duty through the end of June, up from 50 during that same period last year, the report says.

Viewed historically, the 65 puts mid-year 2017 among the safest periods for police officers in the last four decades. The only years in which there were fewer fatalities at mid-year were 2016, 2013, and 2012.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The number of officers killed by gunfire in the first half of 2017 rose a bit compared to the same period in 2016, from 21 to 23, the report said. There were 65 firearms-related police deaths in all of 2016, far below the peak of 84 in 1977 but more than the 43 in 2015.

Among particular circumstances of deaths, the largest rise in 2017 came in a category called "other," which includes job-related illnesses. They rose from eight to 16. Five were heart attacks, likely stress-related, and three were related to rescue and recovery efforts after 9/11.

Single vehicle car accidents, in which an officer crashed without making impact with another vehicle, rose from three to 10, a jump that the fund called "alarming."

This has been a concern of the fund for many years, President and CEO Craig Floyd said.

In 15 of the last 20 years, traffic fatalities have outstripped all other types, he said. That trend flipped last year, when shooting deaths took the top spot.

Related: 2016 Sees Year-Over-Year Spike In Cops Killed By Gunfire

"Officers are wired differently than the rest of us," Floyd said. "When they get a call for help, they go racing to the scene, drive at high rate of speed and put themselves at risk because they're worried about saving another human being's life and they don’t think as much about their own safety. But we tell them that they can't help anyone if, God forbid, they get into an accident on the way to the scene."

Floyd's organization has developed a program, called Destination Zero, that gathers and shares methods used by police departments to reduce traffic deaths. It focuses not only on speeding but also distracted driving and drowsy driving. One department allows officers to take short naps during their shifts, he said.

The group also raises awareness of so-called "move over and slow down" laws aimed at preventing drivers from getting in the way of officers doing their job.

Floyd also pointed out that the report shows the many ways ─ shootings, crashes, beatings, stabbings, poisonings, disease ─ that officers die because of the work they do.

"I think it tells you that every situation an officer is involved in is potentially life threatening," he said. "The randomness is the reality of law enforcement."