The California man who was shot by a San Diego County sheriff’s deputy after firing two shots in the air outside an Ice Cube concert in 2018 was sentenced to three years in prison this week.

Daniel Elizarraras, 22, pleaded guilty to a single count of discharging a firearm in a grossly negligent manner, which helped him avoid a potential 19-year sentence, according to Fox 5 San Diego. As part of the plea agreement, a charge of assault on a peace officer with a semi-automatic weapon was dismissed.

During the show at Del Mar Fairgrounds on Sunday, September 2, Elizarraras was told he couldn’t buy a ticket to the sold-out Ice Cube concert. He grew upset, pulled out his weapon, and fired multiple shots into the air. Officers on site tried to subdue him with a Taser, but it was ineffective. According to prosecutors, Elizarraras lowered his right hand and pointed his weapon at deputies, which led Sheriff’s Deputy Tyler Eikerman to pull out his firearm and shoot Elizarraras four times.

According to defense attorney Pedro Bernal, Elizarraras was dealing with severe depression and committed the shooting in an attempt to commit “suicide by cop.” Elizarraras reportedly drank heavily and attained a .37 blood alcohol content level that night just to have the courage to go through with the shooting. Bernal noted that his client was extremely remorseful and his emotional stability was not being used as “justification or an excuse, but merely as an explanation for the behavior.”

Deputy District Attorney Michael Reilly said prison time would be appropriate for Elizarraras since he is considered an endangerment to the public since he chose to “put so many lives at risk” when he brought a loaded, unregistered gun to the concert.

“He made a conscious decision to bring a loaded firearm, conceal it on his body, and that firearm’s not registered,” Reilly said, noting that it’s “extremely lucky” that no one else was shot during the incident.

San Diego Superior Court Judge Kathleen M. Lewis agreed with Reilly, confirming that his violent behavior prove she is a “serious danger to society.” He will be serving time in a state prison.