Updated

SACRAMENTO, Calif. -- An armed attempted murder suspect has been shot and killed by police after holding a baby hostage for more than 50 hours at an apartment in Sacramento, FOX 40 reported Friday.

The Sacramento County Sheriff's Department said 26-year-old Anthony Alvarez was shot shortly before 7:30pm.

His hostage, one-year-old Michael Pittman, Jr., was successfully rescued and is unharmed.

He has been taken to hospital as a precaution.

Sheriff John McGinness described it as a "successful operation" and said the needs of the public had been met while ensuring the safety of the child.

Fox 40 reporter John Lobertini said a crowd of people who had gathered near the scene began cheering when the baby emerged safely in the arms of a law enforcement official.

"It was was one of the most amazing moments you will ever see," he said.

Alvarez, who was described by police as a "very dangerous" man, had been holed up inside unit 29 of the Arden Towne Apartments for more than two days.

The 26-year-old, who is suspected of attempted murder and armed robbery, was spotted by police inside the complex's parking lot on Wednesday.

After seeing police, Alvarez grabbed the one-year-old son of his cousin and dashed into unit 29, triggering the standoff.

Over the course of three days, officers and Alvarez have exchanged gunfire multiple times.

Alvarez, who had been in contact with family members since the start of the stand-off, reported that he had received a head injury and a bullet injury to the arm.

However, a press release issued by the Sacramento County Sheriff's Department Friday morning said SWAT officers did not believe Alvarez has been shot.

Authorities had been using loud alarms and flash bang devices in an effort to draw Alvarez out of the apartment by making the situation as uncomfortable as possible.

Sacramento's longest stand-off in history -- surpassing the deadly "Good Guys" hostage situation from nearly two decades ago -- had not been immune to its share of bizarre events.

A woman was detained by law enforcement officials Thursday after she scaled the roof of the apartment building, claiming she wanted to rescue the infant held hostage and read him a poem.

It is unclear when Arden Way would be reopened.

McGinness said families would be allowed to return to their apartments as soon as law enforcement could be sure that doing so would not compromise evidence at the crime scene.