This post has been updated.

After a nearly 12-hour standoff with multiple law enforcement agencies in Tacoma, Wash., a 38-year-old man suspected of fatally shooting a police officer Wednesday was killed by a single bullet from a SWAT team member early Thursday morning.

The man, whose name has not been released, had barricaded himself inside a three-story home on the city’s east side late Wednesday afternoon after unleashing bullets on two Tacoma officers who had responded to the residence after reports of a verbal domestic dispute between two people.

The man’s wife and another woman were able to escape the gunfire Wednesday, reported the News Tribune, but local authorities did not say until after the suspect was killed that two young children remained inside the home throughout the extensive standoff.

The boy and the girl, believed to be aged 8 and 11, respectively, were rescued from the home by a SWAT team around 3:20 a.m. local time Thursday, and were taken to the hospital for an evaluation, authorities said.

Police knew all along that the two children were trapped inside with the gunman, but didn’t share that information with the public for “tactical reasons,” Pierce County sheriff’s detective Ed Troyer told The Washington Post.

“Our priority was to make sure those kids were safe,” Troyer said. “We weren’t going to let those children get hurt.”

Troyer couldn’t say exactly how authorities managed to pull the children to safety, but he told The Post that there were negotiators outside the home and law enforcement officers inside the home who “never left” for the duration of the standoff. The man, who was armed with multiple weapons, had barricaded himself and the two children in an upstairs bedroom and refused to let them go, Troyer said.

The sheriff’s department SWAT team was able to rescue one of the children, Troyer said, then separate him from the second. Before he could reach his weapons, a SWAT officer fired a single, fatal round, and authorities were able to safely remove the children from the home.

“They showed great patience and restraint to make sure those kids were out safe,” Troyer said. “The whole situation is horrible. We have a deceased officer, but we have a whole lot of heroic ones that went in and got those kids.”

The standoff, grueling in the November cold, began just after 4 p.m. Wednesday, when two Tacoma police officers responded to the house, according to authorities. The News Tribune, quoting police, reported that the officers knocked on the front door when they arrived, and “a very short time after,” called for priority backup. Then a “shots fired” call went out over the radio.

Responding officers were able to pull the injured one from the home, authorities said. He was transported to Tacoma General Hospital and underwent surgery, but could not be saved. Authorities announced his death late Wednesday evening, and hours later Police Chief Don Ramsdell told reporters the officer, who has not yet been named, was a 45-year-old, 17-year member of the force.

“We’ve suffered a great loss and I think the community has suffered a great loss. And I don’t know how to put that into words other than to say that everyone here appreciates the kind thoughts and the prayers that are going out to us,” an emotional police spokeswoman, Loretta Cool, told reporters.

Dozens of solemn, uniformed officers lined the sidewalk outside the hospital Wednesday night, silently waiting for the body of one of their own, while across town hundreds of officers from multiple law enforcement agencies swarmed the startled neighborhood, still locked down while authorities worked to end their standoff.

It remained unclear Thursday morning what led the gunman to shoot at officers.

Cool initially said several people in the home were able to immediately leave after the shooting, but she couldn’t say how many, their ages or their genders. Police told the News Tribune that the prospect of protecting others in the home may have prevented the responding officers from fleeing the dangerous situation.

“You had someone in the house who was shooting and you just can’t leave somebody inside,” Cool told reporters.

Kristi Croskey was one of the people who fled the home once the shooting began. A photo from the scene shows Croskey, distraught, sitting on the ground against a white picket fence, surrounded by police.

She once lived in the home but moved out seven months ago, she told TV station KING 5. Croskey was there Wednesday afternoon to retrieve some items she had left behind, and said she knew the suspect and his wife but wasn’t aware of any issues in their relationship.

“I’m caught off guard just like everybody else,” Croskey told KING 5.

In a different interview with TV station KIRO 7, Croskey said she owns the home and attends church with the suspect.

She spoke emphatically of her support for the Tacoma police department and said that the officers there were trying to protect the safety of those inside and of the shooter.

“I don’t want to hear anything about black lives matter, because all lives matter,” she said. “I want to say the Tacoma Police Department handled this matter with such professionalism . . . despite one of their own being shot.”

Cool said the department has 381 employees who all know each other. This loss, she said, is profound.

“Remember that we still have a job to do, we are still on the scene and we are doing our best to not have anyone else injured or harmed tonight in any way,” she said. “We all will take our time when it’s appropriate to grieve and to share our thoughts and feelings on our friend. …

“Everyone in our police department knows everyone and yes, everybody will feel it.”

On social media, law enforcement agencies across the state shared their support for the Tacoma department. Sheriff John Urquhart ordered all King County Sheriff’s deputies to wear “mourning bands.”

In a statement, Washington Gov. Jay Inslee (D) said he and his wife, Trudi, were praying for and thinking about the family and loved ones of the slain officer.

“All of Washington grieves with Tacoma, which tonight lost one of their finest,” the governor said. “In times of crisis, we see the service and resolve of law enforcement as they run towards the danger. Tonight an officer was taken from us while serving his community, and it is a reminder of the sacrifice that these men and women across our state and nation make every day.”

As a SWAT team surrounded the crime scene Wednesday night and authorities worked to take the suspect into custody, dozens of other officers stood guard outside the hospital alongside members of the public and journalists as the slain officer’s body was brought outside and loaded into a Tacoma Fire Department ambulance. At 10 p.m., a procession of police motorcycles and patrol cars escorted the officer to the medical examiner’s office.

Wednesday’s fatal shooting marks the 11th time a Tacoma officer has been killed in the line of duty, according to the Officer Down Memorial Page. The last officer who died was killed in a motorcycle accident in 2004, and the last time a Tacoma officer was killed by gunfire was 1997.

The death of this officer comes a little more than a week after a spate of cross-country, targeted attacks on officers in a 12-hour period in Florida, Missouri and Texas. The officers were all inside their cars when shooters ambushed them, authorities said. The Texas officer was killed.

According to the National Law Enforcement Officers Memorial Fund, 61 officers have died in firearms-related incidents this year. In total, 132 officers had been killed in the line of duty so far in 2016.

This story is breaking and will be updated.

More from Morning Mix: