WASHINGTON — The first shots were fired just before 9 p.m. A protest against deadly shootings by police was winding down in Dallas, with demonstrators making their way back to their cars, when officers heard the initial burst of gunfire. By the time it was over, five police officers had been killed, several others were injured, and a gunman was dead after a standoff with officers.
The Dallas ambush was the deadliest day for law enforcement since Sept. 11, 2001. That bloodshed, coupled with another attack days later in Baton Rouge, helped fuel an increase this year in the number of police officers slain in the line of duty, a tally pushed upward by a surge in ambush attacks and other shootings.
Gunfire was the common factor in nearly half of all police deaths in 2016. So far this year, 64 police officers have been killed in shootings, up from 41 at the same point last year, according to the National Law Enforcement Officers Memorial Fund, a nonprofit group that monitors line-of-duty deaths.
Nearly 1 in 3 officers fatally shot was killed in what the group called ambush attacks, including the high-profile assaults in Dallas and Baton Rouge that left eight officers dead and shook law enforcement nationwide.
The surge in officers killed by gunfire this year is the largest on record, up 56 percent over last year, the memorial fund’s data shows. That highlights a stark fact that has come into shape in recent years: Guns are increasingly the cause of line-of-duty deaths, according to an analysis of the memorial fund’s data. Nearly half of all officers slain in the line of duty were killed with guns, the highest percentage of deaths in more than two decades.
Baltimore County Police Chief James W. Johnson said last year that the risk to officers is magnified by ‘‘the amount of guns that are out on our streets today, possessed by those who unlawfully are carrying them.’’
Similarly, Craig W. Floyd, president and chief executive of the National Law Enforcement Officers Memorial Fund, pointed to the ‘‘deadly mix’’ of mentally ill people accessing firearms as one factor in the uptick in gun deaths. He also said there were dangers posed by antigovernment extremists looking for a uniformed symbol of the government, as well as people with extensive criminal records who may view police as the enemy.
‘‘They in many cases have called 911 and waited for the police to arrive,’’ Floyd said, pointing to the case of Sonny Kim, a Cincinnati officer killed last year exchanging gunfire with a suspect who police said had summoned officers.
Before this year, more officers were killed by traffic accidents than gunfire in 15 of the past 20 years, according to the memorial fund. Traffic-related deaths, which include collisions and officers struck while on the side of the road, had ticked up and peaked in 2007. They have since declined and, this year, accounted for fewer than 4 in 10 officer deaths.
Ambush killings dominated the headlines after a burst of violence in July. Officers fatally shot two men — Alton Sterling in Baton Rouge and Philando Castile in Falcon Heights, Minn. — on consecutive days in July. Video footage recorded during and after both encounters quickly emerged and set off demonstrations across the country, the latest protests prompted by the deaths of black men during encounters with police officers.
Police have shot and killed nearly 1,000 people this year, according to a Washington Post database tracking such deaths, and a handful of cases have prompted intense demonstrations. In most fatal shootings, officers say they were confronted by people with guns, and in about half of the cases, these people fired at the officers.
Demonstrations began in a number of cities after Sterling and Castile were killed. The Dallas protest was calm and peaceful before an eruption of violence aimed at law enforcement. The gunman told police he was not involved with the protests and acted alone before authorities killed him using a robot-delivered bomb. Ten days after, a gunman spent his 29th birthday fatally shooting three Baton Rouge officers before a SWAT team member took him down from more than 100 yards away.
All told, with days remaining in 2016, the number of officers killed in ambush attacks this year is more than double the average from the previous decade.
