On his fourth day on the job, rookie San Francisco cop Chris Samayoa was still getting out of his patrol car when he fatally shot an unarmed carjacking suspect.

A little more than three months after that fateful fourth day on the beat, Police Chief Bill Scott fired the officer for killing 42-year-old Keita O’Neil, sparking outrage from the city’s police union and its president, Martin Halloran.

“Chris was fired for doing what he was trained to do by the SFPD Academy, and for what happened on his fourth day on the job under extremely stressful and difficult circumstances,” Halloran wrote in a statement. “This was a needless action as any taken by someone wearing the uniform of our chief.”

On Dec. 1, O’Neil allegedly assaulted a state lottery worker on Potrero Hill and stole her minivan before leading police on a winding chase that led through the Alice Griffith public housing complex in the Bayview neighborhood.

After the brief pursuit with police, O’Neil abandoned the stolen vehicle and started running toward the patrol car occupied by Samayoa and his training officer.

Samayoa’s body camera footage shows the officer drawing his pistol from the passenger seat while the cruiser is still moving. The video then shows him opening the side door and firing a single shot through the window as O’Neil, who was unarmed, runs by in the opposite direction.

O’Neil was transported to San Francisco General Hospital, where he was later pronounced dead.

Samayoa turned on his body-worn camera after shooting O’Neil, an apparent violation of Police Department policy. The Axon body-worn cameras have a feature that preserves the previous 30 seconds before they are activated — similar to a television DVR — though without audio.

Despite this violation of department policy, Halloran called Samayoa a “textbook example of what a police officer should be.” He added, “Chris is an exemplary human being.”

The Police Department confirmed that Samayoa was fired but declined comment, noting that it was a personnel matter. The decision was first reported by Mission Local.

Born and raised in San Francisco’s Mission District, Samayoa studied psychology at the University of Arizona. He was studying for his master’s degree in psychology and counseling at the University of San Francisco when he took a leave of absence to be part of the 257th Basic Academy Class of recruits.

At a town hall meeting held nearly a week after the fatal shooting, community members expressed outrage over the shooting of O’Neil. Bayview residents shared their concerns about the shooting with Chief Bill Scott, Bayview Station Capt. Steven Ford and Capt. Valerie Matthews, head of the department’s field operations.

“Y’all not only killed (O’Neil), y’all killed his mom,” said Demetrius Williams, O’Neil’s friend. “She’s dying of cancer, fighting for her life, and now she’s burying a son.”

The shooting remains under investigation by the department’s internal affairs division, the homicide bureau and the San Francisco district attorney’s office.