The suspect was identified on Thursday as 45-year-old Adel Sambrano Ramos.
Ramos was arrested after a more than eight-hour standoff in North Sacramento on Wednesday. He surrendered to police and was taken into custody.
[Ads /]
Deputy Chief Dave Peletta said during a news conference early Thursday that O'Sullivan died at UC Davis Medical Center hours after the gunman opened fire on her while she was assisting a woman with removing belongings from a home. The woman was not injured.
Sgt. Vance Chandler of the Sacramento Police Department said, "We had multiple officers on scene with the female helping her gather some belongings, and while our officers were on scene, one of our officers was shot."
Peletta said O'Sullivan was partnered with a training officer when she was shot just before 6 p.m. He did not offer any more information.
The gunman continued shooting, keeping other officers at a distance. Police exchanged gunfire with him.
[Ads /]
RELATED: Who was Officer Tara O'Sullivan?
Because police were in a standoff with the suspect, and he was firing his rifle, they couldn't get to O'Sullivan for about 45 minutes. Ultimately, they needed to drive into the area in an armored vehicle to rescue her.
O'Sullivan later died at the hospital.
The Sacramento Bee reports that, according to city records, O'Sullivan had been working for the city since January 2018.
She grew up in the East Bay city of Pleasant Hill and graduated from College Park High School in 2011.
O'Sullivan was part of the first class of graduates of Sacramento State's Law Enforcement Candidate Scholars program in 2017 and went on to the Sacramento Police Academy.
[Ads /]
O'Sullivan is described as having a bubbly personality and was always willing to help. She was said to have big dreams and a big heart.
Many Northern California police departments shared their thoughts on prayers for O'Sullivan on social media Thursday.
If you would like to donate to the Officer Tara O'Sullivan Memorial Fund, visit this page.
The Associated Press contributed to this report.