An hours-long standoff between a gunman and police came to end on Thursday, but not before taking the life of an officer in Sacramento, California.

The root incident was on Wednesday afternoon when Sacramento Police received a call about a domestic disturbance. Officers responded around 3:30 P.M. to help a woman present gather her belongings to leave.

After attending to the woman for several hours, an unidentified man arrived at the house after 6 P.M. armed with a rifle. He began shooting indiscriminately into the house, hitting Officer Tara O’Sullivan who collapsed in the yard. Despite the gunfire, police were able to get an armored vehicle to the house and safely get Sullivan to safety.

During the chaos, the shooter barricaded himself in the house as the police evacuated local residents and set up a perimeter around the house. What followed was a long standoff between the police and shooter who continued firing on police. The standoff continued until early Thursday morning when the shooter surrendered to police.

As the standoff ensued, Sullivan was rushed to UC Davis Medical Center for emergency surgery on her gunshot wounds. It was to little avail as Sullivan was pronounced dead shortly after arriving at UC Davis.

“Officer Tara O’Sullivan was shot and killed,” Deputy Police Chief Dave Peletta said in a press conference Thursday morning. “She gave her young life while protecting our community.”