(CNN) -- The man who held a 16-month-old boy hostage and kept police at bay for 55 hours in Sacramento, California, was shot to death by SWAT team members, authorities confirmed early Saturday morning.
"The child is fine," Sacramento County Sheriff John McGinness told reporters.
The boy was carried away in the arms of a SWAT team member and reunited with his family. He suffered a minor glass cut, said Tim Curran, a sheriff's spokesman.
McGinness said the SWAT team broke into the apartment Friday evening after he had given the order to use deadly force if they had the opportunity to do so without harming the little boy.
"I gave them the absolute green light to do so if that opportunity presented itself," McGinness said. "It did, they did, the child is safe.
"This is, in fact, a very, very successful operation," he said.
Reporters on the scene said the operation began with a "flash-bang" designed to disorient the suspect, identified as Anthony Alvarez, 26.
Thirty minutes later, they heard gunshots, and shortly after that, the SWAT officer emerged with the boy, carrying him to a waiting ambulance.
Alvarez had been holding authorities at bay since Tuesday, when police tried to arrest him in connection with a series of armed robberies, the attempted murder of police officer and a possible connection to a homicide in the San Francisco Bay area, a police spokeswoman said.
The incident began when Alvarez grabbed his cousin's two children, ages 4 years and 16 months, before fleeing into an apartment as police approached, according to Sacramento County Sheriff's spokeswoman Sharon Chow.
Deputies rescued the oldest child through a rear window, she said, but Alvarez had been inside since with the infant.
Chow said Alvarez opened fire at one point on a robot SWAT teams tried to send in to get a visual on the situation. For the most part, she said, Alvarez avoided being seen, although from time to time he has been seen carrying the child, which prevented police from taking action.