(CNN) - For hours, the barrage of gunfire just wouldn't stop.
Sacramento police Officer Tara O'Sullivan lay on the ground bleeding as gunshots echoed and her colleagues tried to get to her. The suspect fired incessantly, preventing officers from reaching her for at least 45 minutes, authorities said.
O'Sullivan, 26, and her fellow officers had gone to a home in Sacramento after a disturbance call Wednesday and were helping a woman gather her belongings when a man opened fire, Police Chief Daniel Hahn said.
Armed with what appeared to be a high-powered rifle, police said, the suspect blasted rounds every time he saw movement -- at least 30 times over the next four hours. To fend him off, officers fired back more than 100 rounds, Hahn said.
Police vehicles, ballistic vests and ballistic shields were no match for the hail of bullets, so police requested an armored vehicle to rescue O'Sullivan as she lay in the backyard with fatal gunshot wounds.
By the time they got to her, it was too late. The tense standoff and dangerous rescue ended with a suspect in custody and an officer down.
O'Sullivan had recently graduated from the police academy and was scheduled to be on her own in a few weeks.
"She was helping a woman get away from an environment she didn't want to be in and helping her get her belongings," Hahn told reporters Friday. "She paid the ultimate sacrifice to do that."
Police called for backup after finding weapons
The incident started with a disturbance call at 11:43 a.m. local time and dragged on for hours.
When officers arrived at the home, they found the front door barricaded, Sacramento police Sgt. Vance Chandler said. O'Sullivan and her training officer learned the man also had a connection to the house next door, so they went there to try to contact him and get the woman's possessions. He wasn't there, Chandler said, but they found two firearms.
The two officers called for backup, and three additional officers responded.
The woman told the officers she also had belongings in the detached garage at the back of the yard. Not knowing where the suspect was and if he was armed, the five officers approached the garage together.
Body camera footage released Friday shows the lead officer entering the doorway of the garage.
"Police Department. If you're in here let me know," the officer called out. "You're not in trouble, dude."
Shots rang out and the standoff dragged on. Officers finally went to the house with the woman at 5:41 p.m.
The suspect allegedly had weapons all over the house
What followed was a more than four-hour standoff.
As the officers approached the garage in the back, the suspect remained in the main house, where police later found four weapons: two assault rifles, a handgun and a shotgun, Chandler said. The weapons were placed strategically throughout the house, he added, and police later found casings throughout the home.
The suspect also had multiple cameras around the house, and likely used them to watch police movements, he said.
Hahn described it as an ambush.
"It is clear by the suspect's actions that he was intent on murdering additional officers and was taking action to do just that, repeatedly shooting at officers throughout much of this incident," he said.
The rescue: Officers carry her through gunfire
As the bullets flew, O'Sullivan remained in the yard, still in the line of fire.
When the armored vehicle arrived 14 minutes after it was requested, officers at the scene had to figure out how to maneuver the vehicle through a pole, chain link fence and a wood fence to get to her, police said.
Once they got close to O'Sullivan, an officer jumped out and fired at the suspect while the others ran out to pull her inside the vehicle, Chandler said. While they backed out of the scene, the armored car "became disabled," Chandler said. The officers carried her to the patrol car and drove her to the hospital.
After hours of negotiations, the suspect surrendered.
CNN's Eliott C. McLaughlin and Joe Sutton contributed to this report.
The-CNN-Wire ™ & © 2019 Cable News Network, Inc., a Time Warner Company. All rights reserved.