When Louisiana police officer Shawn Anderson called his wife, Becky, on March 18, he said he had one more suspect to interview and would see her the next morning. But an hour later, a SWAT team arrived at Becky’s doorstep. They told her that her husband, an 18-year veteran of the East Baton Rouge Sheriff's department, had been shot and killed responding to a call that night.

Reflecting on Anderson's death in the line of duty, Becky said he used to say he was not afraid of being shot. "He told me, 'I'm afraid of leaving you and the kids here by yourself,'" she recalled.

“Telling Shawn not to be a police officer was like telling him not to breathe,” Becky told NBC News.

Sgt Shawn Anderson holds Declan Walsh, a baby he delivered on March 19, 2016. Courtesy EBR Sheriff's Office

Anderson was one of 44 officers killed on duty in firearms-related incidents in 2017, according to new data from the National Law Enforcement Officers Memorial Fund. It's a 33 percent decline from last year, though experts remain concerned about ambush attacks as a broader debate wages around policing in America.

Eight of this year’s officer killings were from ambush attacks, also marking a decline from 2016, when the country saw a surge of ambush killings targeting officers, with 21 officers killed in those attacks and 66 total officers killed by gunfire.

Craig Floyd, who tracks every officer death as president of the National Law Enforcement Memorial Fund, says it’s important to remember the officers who gave their lives in the line of duty this year.

Floyd suggested that preventive measures have decreased the total number of officers killed on duty. “Technology has helped,” he said. “Training has made a difference.”

Still, “one ambush attacks is one too many,” said Marq Claxton, a retired NYPD Detective & Director of the Black Law Enforcement Alliance.

Gun violence takes a toll

According to his family and friends, Detective Jerry Walker embodied the values of public service. The 47-year-old was tough, kind and disciplined, a certified hostage negotiator and SWAT team member who served as a school resource officer at a high school in Little Elm, Texas, a suburb of Dallas.

Walker, an 18-year veteran of the Little Elm Police Department, saw himself as a sheepdog that protected others, a mission he tattooed on his body.

“There are wolves. There are sheep. I am the sheepdog," the tattoo read.

Detective Jerry Walker Courtesy Slay Memorial Funeral Center Aubrey

“He’s going to be out there on watch,” Beverly Walker, his mother, said, “making sure that the wolf doesn’t get to the sheep.”

Walker was shot to death in January while responding to an emergency call. He knew the danger when he arrived at the crime scene, where an armed man yelled at police officers and then retreated to barricade himself inside a house. Walker was part of the team stationed outside. Hours later, the shooter opened fire from inside the home, killing Walker.

He was the second child Beverly lost to gun violence. When Walker was 17, his 10-year-old brother, Bragan, was killed in a shooting accident at a friend’s home.

“I didn’t think I would lose another baby,” Beverly told NBC News. “My consolation is that I know they’re together, and I know they’re in heaven, and I know they’re happy.”

Another family member of an officer killed this year, Louise Cummings, was also no stranger to sudden loss.

Her husband, Corporal Stephen Ballard, was shot and killed while investigating a suspicious vehicle in April in Bear, Delaware. She says she accepts his fate as part of his “noble profession” of service. “He needed to die and be a hero for all,” she said.

Before she was married to Ballard, Cummings' boyfriend of five years died in 2011 after going into cardiac arrest.

“We have so many questions about anything that happens in the world, especially when it's tragic or traumatic,” Cummings said. “I have to believe it’s for a bigger purpose.”

The president "felt the pain"

This July, Detective Miosotis Familia was the first woman NYPD officer killed in the line of duty since the 9/11 attacks. A pedestrian approached her vehicle and shot her in the head, one of the eight ambush killings this year.

Familia chose a midnight shift, her family recalls, because she wanted to spend more of the daytime with her family. “Her priority was always her children and my mother,” said her sister Mercedes Proefrock, who recalled Familia’s “contagious smile.”

“To see someone and then having them disappear like that, it’s hard,” she added.

NYPD Detective Miosotis Familia Courtesy Mercedes Proefrock

President Donald Trump called Proefrock after Familia was killed.

“That moment, I respected that man,” Proefrock said. “The president took two minutes of his time to make me feel like she didn’t die in vain — to show her children that the President of the United States also felt the pain.”

Floyd, who tracks officers killed on duty, said that while the rate of ambush attacks fluctuates, some departments have improved responses through situational awareness.

“We need to be always aware of the dangers that lurk around us,” Floyd said, “in terms of people literally attacking and assassinating law enforcement officers.”

Whether an officer lives or dies can also depend on funding and technology, Chuck Wexler, who runs the Police Executive Research Forum, which advocates advancements in policing through research and policy developments, said.

“Approximately one-third of officers killed in the line of duty each year don’t have body armor,” Wexler said.

Wexler added that commemorating and honoring the fallen officers reinforces public esteem for a very tough job.

“The community really empathizes with what the police have to do,” said Wexler, especially when they were killed for “simply performing their job.”

Remembering the fallen

While some families said they have found some kind of acceptance of their loss, others emphasized their daily struggle.

“I’ve really struggled with the fact that he was murdered,” Chris Michael said of his brother Officer Gary Michael, who was fatally shot during a traffic stop in Clinton, Missouri, in August. “That somebody’s decision took him away.”

“It’s a nightmare that I’m still waiting to wake up from,” said Frances Von Hof, whose son, Corporal Michael Middlebrook, was killed by a gunman when he responded to a crime scene at a convenience store in Lafayette, Louisiana, in October.

Lafayette Police Cpl. Michael Middlebrook Courtesy Frances von Hof

She told NBC News that his service demonstrates how most police serve to “keep the peace and to help people.”

Middlebrook had faced close calls before.

Just this January, he intervened in a dispute between two men and shot one, wounding him. His mother recalled that he asked her to “pray” the suspect he shot “doesn’t die.”

After that harrowing incident, Middlebrook’s wife, Adrienne, said she told him, “One day you’re not going to be so lucky.”

Now, she said, she still finds herself expecting him home to greet their 4-year-old daughter when his shift would have been over.

“I’m waiting on him to return home,” she said, “and he’s not returning.”

A steady decline over decades

While on-duty shootings are down this year, law enforcement experts said that ambush attacks reflect a new front in antipathy toward police. Meanwhile, debates about policing and civil rights continue across the country.

Just this month, the president incorrectly claimed violent assaults against police are increasing.

“We have seen an alarming increase in violent assaults carried out against our police officers,” Trump told graduating law enforcement officers at an FBI National Academy Graduation Ceremony on December 15.

Overall, killings of police officers and ambush attacks declined this year. Over the past few decades, police fatalities have been steadily declining, with a spike in 2016.

“You have to go back to the 1950s, to find a number lower than what we had in this decade,” said Wexler, the law enforcement expert.

But in the police community, family members and advocates tell NBC News the aggregate data only tells a small part of the story.

“It’s devastating because it exposes just how dangerous the profession is,” said Claxton of the Black Law Enforcement Alliance, “how vulnerable you all are individually.”

Officer Matthew Baxter Courtesy Sadia Baxter

Special Agent Sadia Baxter, who lost her husband, Officer Matthew Baxter, in Kissimmee, Florida, in August, said that she would continue to work in law enforcement, despite the dangers of the profession, in order to “keep [her] husband’s legacy alive.”

Other family members of fallen officers say they are concerned some debates over problematic police practices have dented the wider respect for the job.

“Behind that badge, underneath that blue — they’re human beings. They’re people that have families,” said Proefrock, the sister of the NYPD officer ambushed by a pedestrian. “We tend to forget that.”

Reflecting on this difficult year, Proefrock added that she believes respect must run in both directions.

“We as a people have forgotten to respect [police],” she said, “and the officer also has to respect the community.”