San Francisco District Attorney George Gascón has cleared three police officers in two separate shootings in 2018, including one in which one man was shot in the back as he fled and another involving a hostage rescue.

Gascón announced Monday he would not file any criminal charges against the officers in the shootings of Oliver Jose Barcenas, 28, who survived after he was shot in the back, and Damien Murray, 46, who died after he was shot.

The district attorney’s Independent Investigations Bureau cleared Officer Joshua Cabillo in the shooting of Barcenas on June 9, 2018, saying “it was not possible to establish beyond a reasonable doubt” that Cabillo did not act in self-defense or while defending others.

Cabillo shot Barcenas in the back just after midnight as he fled after police approached him and three other men who had open containers of alcohol on the corner of Grant Avenue and Vallejo Street in the North Beach neighborhood, which was crowded with people celebrating the Warriors’ NBA championship earlier in the evening. Investigators said surveillance videos from local businesses confirmed that Barcenas pulled a gun with an extended magazine from his waist before he was shot.

About eight seconds after the chase began, according to the summary, Cabillo fired his gun twice, striking Barcenas in the lower back.

Cabillo, then a five-year San Francisco Police Department veteran assigned to the Field Operations Bureau, told investigators he feared for his life and those of people spilling out of local bars.

“Officer Cabillo said his fear for their lives was magnified because Barcenas’s gun was ‘superior’ to his — that is, Barcenas’s gun had an extended magazine and he could therefore shoot more rounds and faster than could Officer Cabillo,” according to the summary.

The investigation also found that Cabillo fired “milliseconds” after Barcenas tossed the gun to the ground. The officer testified he didn’t see the gun being tossed.

Barcenas pleaded guilty in December to a charge of a felon in possession of a firearm and was later sentenced to 84 months in prison.

The shooting of Barcenas was the second time Cabillo was cleared in an officer-involved shooting. In 2012, when he was a police officer in South San Francisco, San Mateo County District Attorney Steve Wagstaffe cleared him in the fatal shooting of 15-year-old Derrick Gaines, who allegedly pulled a gun during a struggle.

Two police officers were cleared in the fatal shooting of Murray. On Sept. 24, officers Jason Robinson, a 15-year veteran, and Wilrolan Ravelo, a nine-year veteran, responded at 11:35 p.m. to a home on Salmon Street in North Beach, where they found Murray armed and refusing to allow his girlfriend and their two children to leave a bedroom.

Murray fired a shot as officers arrived and then refused to surrender to hostage negotiators before firing his gun again, investigators said.

During a rescue operation, officers entered the bedroom and seconds later, after Murray either reached for a gun or lifted a gun, Robinson and Ravelo fired their rifles at Murray, hitting him five or six times. Murray later died at a local hospital. The woman and children were uninjured.

The investigation found that Murray had told officers when they arrived at the scene he would “start shooting.” The interaction was recorded on officers’ body cameras.

In addition, evidence included recorded phone calls with hostage negotiators, in which Murray told officers that if they broke into the apartment, “everyone was going to die.”

Robinson and Ravelo told investigators that Murray was angry and aggressive and they feared he was going to shoot them.

The investigation, however, highlighted the fact that at the beginning of their interviews, Ravelo and Robinson each submitted a written statement, which “were identical in substance, format, and word choice and even had the same typographical error, despite the officers’ differing roles and perspectives.” Ravelo told investigators he did not prepare his statement with Robinson.

Yet investigators said those statements were not material given the individual accounts during interviews and other evidence, which led to a conclusion that it couldn’t be established “that the use of deadly force was unreasonable.”

“Given Mr. Murray’s earlier threats, discharge of his gun, and the danger that he presented by his reaching for his gun when officers confronted him during the hostage rescue, the District Attorney declines to file any criminal charges for either officer in this matter,” according a statement issued Monday by Gascón’s office.

A previous version of this story misspelled the last name of Derrick Gaines.

Jill Tucker is a San Francisco Chronicle staff writer. Email: jtucker@sfchronicle.com Twitter: @jilltucker