The FBI agents approached the building just before dawn, expecting to knock on the door and catch the 55-year-old systems engineer inside off guard. Investigators had linked an IP address suspected of possessing child pornography to David Lee Huber’s apartment in Sunrise, Fla., and they intended to seize computer equipment to help prove their case.

Such searches have become frighteningly routine. Less than 10 miles north, local sheriff’s deputies were moving in on a different house at the same time, with the same goal in mind.

But inside the taupe building in Sunrise, Huber spotted the agents — possibly through a doorbell camera that let him see outside, officials said. He grabbed a long gun and opened fire through the door, killing two agents and wounding three others, then barricaded himself inside and took his own life, officials said.

The incident — the first time since 2008 that FBI personnel were fatally shot while performing law enforcement work — is forcing the bureau to assess whether it should have done anything differently to avoid such a tragedy, perhaps gathering more intelligence on Huber in advance or using a more aggressive approach to carry out the search warrant.

Former law enforcement officials said it illustrates the challenge police and federal agents face daily, as they confront new technologies that let residents monitor their movements and the reality that heavy-handed tactics might also produce deadly results and come to be second-guessed.

“When you serve a warrant at a suspect’s house, it’s an away game for us,” said Thor Eells, executive director of the National Tactical Officers Association. “I’m at a disadvantage.”

Killed in the encounter were Special Agents Daniel Alfin and Laura Schwartzenberger — parents themselves who had made careers of investigating crimes against children. Law enforcement officials have hailed them as heroes.

 At a memorial service Saturday at Hard Rock Stadium near Miami, FBI Director Christopher A. Wray called the slain agents “two warriors who took on one of the hardest jobs in the FBI — crimes against children.” 

“There are no good words to make sense of a loss like this, no good words for a day like Tuesday, or like today,” Wray said. “There’s a heaviness in our hearts, a burden unlike any other, because there is nothing more devastating to the FBI family than the loss of an agent in the line of duty.”

Huber seemed to live a mostly unremarkable life, with no apparent criminal record, public records show.

He had been cited for traffic violations and was involved in a minor car crash in 2017. Online biographies indicate that he worked as a systems engineer, and state business records show he registered two technology companies — Huber Computer Consulting and Computer Troubleshooters 0512 Inc. — in the early 2000s. In 1994, he was issued a pilot’s certificate, according to Federal Aviation Administration records. He was divorced in 2016.

Huber had been living in the Water Terrace apartments in Sunrise, a bedroom community just northwest of Fort Lauderdale, for several years, according to neighbors and public records. April Evans, who used to live in the same building, said she remembered her downstairs neighbor as an odd, standoffish man whose two young sons would sometimes visit him.

In 2018 or 2019, she said, a pest control technician came to service the apartments, and the apartment complex’s management company posted notices that someone might be entering the units. She said the technician came into her apartment shaken, having just come from Huber’s residence.

“He said the man downstairs pulled a gun on him,” Evans said.

Evans said she did not know Huber by name but was familiar with his presence in the building. She said he would drive aggressively in the complex’s parking lot, challenging other residents for spaces, even though they were not typically scarce.

On one occasion, she said, she was sitting with a friend on her balcony talking and heard Huber swearing and yelling “something about being quiet.” She said Huber then walked into the courtyard and looked up at her balcony but walked away without ever directly addressing her.

“He was odd,” Evans said. “Of course, I never imagined that it was anything like that going on with child pornography. As far as his behavior, it was never normal.”

Police in Sunrise had been dispatched to Huber’s address three times last year, according to call records released by the department, though there were no records connecting Huber directly to any of the incidents.

On April 11, according to the records, someone called police to report a shirtless man was throwing fireworks outside. Though police records list the incident location as Huber’s address, a police spokesman said it was possible that merely reflected the closest visible apartment. Huber’s name is not listed in the report.

About 30 minutes later that same day, someone called police to report a man in the parking lot had threatened to chop his head off, making a throat-slashing motion with his hand and raising his middle finger, according to police call records. The caller said the man had been playing loud music that morning, and the caller had asked him to turn it off.

While a report lists Huber’s address as the incident location, the person purportedly making the threats is identified only as a bald, 40-year-old man. Justin Yarborough, a Sunrise police spokesman, said the officer who responded to both incidents did not recall making contact with the subject of the complaints. Records show both incidents were closed without arrests.

In a third incident at the address, on April 26, a caller reported that a “diabetic neighbor came outside screaming” and was “looking up at the sky saying its time to go,” according to a call record of the incident. The record indicates officials rendered medical assistance but identifies the man who needed help only as a 50-year-old with gray hair.

Eells, of the National Tactical Officers Association, said officers serving warrants generally will research the background of a person whose home they are searching — including their criminal history and associates — and scout the location.

“As you compile all of that, you begin to assess the risk,” Eells said. A recent parolee known to carry weapons might warrant a SWAT team breaking in; a woman with no history of violence thought to have written bad checks will bring a less aggressive response.

The FBI has so far declined to detail precisely what information it had on Huber before agents went to his house, nor has it released details of the deadly encounter. Law enforcement officials, speaking on the condition of anonymity because the bureau’s inspection division is still investigating the incident, said the warrant was standard and would have required agents to knock and announce their presence before going inside. The document remains under seal.

It remains unclear whether agents were even able to announce their presence before Huber started shooting, the officials said. Law enforcement officials said Huber had a doorbell camera, and it was possible he was able to track their movements outside, confirming previous reporting by the Miami Herald.

David Gomez, a former senior assistant special agent in charge of the FBI’s Seattle Field Office, said the proliferation of such devices poses new challenges for law enforcement.

“It’s an unobtrusive surveillance device that you don’t normally think of unless you have one,” he said. “And it’s not always on. It’s unfortunate they’ve been the first ones to get caught up in it. It gives away who you are and your position.”

Eells said the FBI might have been sensitive to possible criticism it could incur from a no-knock raid. Such searches can also end in tragedy when residents don’t realize it is law enforcement entering their home.

“The perception will be that’s an over-response because nothing violent happened or resulted. That’s the dilemma,” Eells said. “Does a law enforcement leader want to assume that kind of criticism in a very tenuous time right now?”

The nature of the allegations against Huber might have made him particularly desperate. Lauren Hersh, a former prosecutor in the Kings County, N.Y., District Attorney’s Office who is now the national director of the anti-human trafficking group World Without Exploitation, said child porn cases require particular care.

“You’re dealing with people who have a total disregard for human life, if this is their crime of choice, and you’ve got to act accordingly,” Hersh said. “Now layer in the current climate, and layer in whatever kind of mental health stuff comes with being locked down for a year [due to the pandemic], and the conspiracy theories out there. In this moment in time, police have to operate with a great deal of caution.”

But other observers noted the FBI arrests people weekly for suspected crimes against children, if not more often, and they virtually never end in agents being attacked. Because Huber had no apparent criminal record, it might have been difficult to convince a judge to approve a warrant that would allow law enforcement to bust into his home without announcing their presence.

Alfin and Schwartzenberger were no strangers to investigating crimes against children. Schwartzenberger had been assigned to work such cases for more than seven years, Alfin for more than six.

“From what I’ve seen in the media, this guy had no criminal history or any indication of violence. . . . I’ve been a part of many searches on this stuff, I never had a violent experience,” said Jeffrey L. Rinek, a retired FBI agent from Sacramento who specialized in investigating crimes against children and later wrote a book about his experiences, “In the Name of the Children.”

Michael Osgood, retired deputy chief at the New York Police Department who spent eight years heading the special victims division, said Huber’s background “probably showed no indication of violence.”

“The child porn offender is, in general, a low violent, low physical threat offender, and they were only there to retrieve physical devices,” he said. “And to judge that [the agents] did something wrong is just false.”

As Alfin and Schwartzenberger were outside Huber’s apartment, deputies with the Broward Sheriff’s Office were at a home in nearby Coral Springs, where they had similarly identified an IP address suspected of sharing child porn. According to a police report, they searched the residence without incident, and the 31-year-old man who lived there admitted to downloading illicit images.

The deputies and SWAT team on the scene, though, were soon diverted, officials said. There had been a shooting involving their FBI counterparts in Sunrise.

Lori Rozsa in Sunrise, Fla., and Julie Tate in Washington contributed to this report.