OAKLAND (CBS SF) — A man who allegedly was so drunk he couldn’t stand up straight has been charged with attempted murder for allegedly accidentally shooting his friend, prosecutors said.

Oscar Omar Avalos, 22, who’s being held at the Santa Rita Jail without bail, was arraigned on the attempted murder charge last week and is scheduled to return to court on Thursday to enter a plea.

READ MORE: COVID Omicron Variant: CDC Expands Surveillance To San Francisco International Airport

Avalos is accused of shooting his friend, Kevin Eduardo Herrera, at Avalos’ house in the 1300 block of 64th Avenue at about 12:30 a.m. on July 26.

Oakland police Officer Kenneth Au wrote in a probable cause statement that when officers responded to the shooting they found Herrera suffering from multiple gunshot wounds but also spotted Avalos, who he said “appeared to be extremely intoxicated in front of his residence alongside the sidewalk in a public place.”

Au said Avalos was unable to stand straight or walk without assistance and “also smelled strongly of alcohol and was repeating the same statements multiple times.”

READ MORE: San Francisco Bay Area Bridge Tolls To Jump By $1 On Jan. 1

Avalos told police that he had consumed a large amount of alcohol and officers determined that he was a danger to himself and was unable to take care of himself due to his high level of intoxication so they placed him under arrest on suspicion of being drunk in public, Au said.

Officers then took Avalos to Highland Hospital in Oakland for medical clearance because of his high level of intoxication, according to Au.

After Avalos sobered up several hours later and was medically cleared, he told police that he was drinking with Herrera at his house and when he was holding his gun in his right hand while they were in the kitchen he shot Herrera by accident, Au wrote.

Prosecutors charged Avalos with attempted murder and a clause of discharging a firearm and causing great bodily injury but they didn’t charge him with being drunk in public.

MORE NEWS: E.G. Daily On 'Rugrat's New Holiday Special "Traditions": 'We Embrace Everyone And Everything'

© Copyright 2015 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.