OAKLAND — A 33-year-old man was found guilty of first-degree murder Tuesday for killing his friend during an alcohol- and drug-infused argument over the existence of God.

Douglas Yim now faces 126 years to life in prison when he is sentenced in November. In addition to the murder, Yim was found guilty of assault with a firearm and mayhem for shooting a second friend in his living room in the early morning of April 2, 2011.

Yim killed Dzuy Duhn Phan, 25, after a night of partying that included them and another friend, Paul Park, drinking alcohol, smoking marijuana and snorting cocaine. Park testified that only Phan and Yim snorted the cocaine and the two began having a discussion about God as they played video games.

Park said that Phan continued to verbally jab Yim about his belief in God, asking Yim where God was every time Yim lost the video game. At one point, Park said, Phan asked Yim where God was when Yim’s father died of a stroke several years earlier.

The comment about Yim’s father immediately sparked outrage in Yim, who threw his video game controller into his flat-screen television, breaking the screen and turning a joyful party into a tense standoff, Park testified.

Park said Yim retreated from the living room and sat in his dining room for about five minutes with a blank stare as Phan and Park tried to calm him down, offering to pay for the television.

But Park said their attempts to calm Yim failed and at one point Phan told Yim that if he wasn’t going to calm down that he should just get his gun and shoot Phan. Phan knew Yim had a gun that he had bought when he began growing marijuana in the basement of his home at 3121 Herriott Ave. in Oakland.

Yim sat for a little longer before he walked 20 feet into his bedroom, loaded his AR-15 assault rifle and then walked back into the living room and immediately began firing the weapon, Park testified.

Testimony revealed that Yim shot Phan at least six times, with one shot being fired from at most a foot away from the side of Phan’s head. Park also was shot in the finger as he put his hands up in an effort to stop Yim.

Alameda County Deputy District Attorney Allyson Donovan argued that the case was first-degree murder because Yim had a chance to think about what he was doing. Donovan asked the jury to focus on the gunshot that hit Phan in the side of the head as proof that the killing was intentional and with premeditation and malice.

On Tuesday, Donovan thanked the jury for its work and hoped that the verdict brought “some sense of closure” to Phan’s family.

“The jury got the verdict correct,” Donovan said. “This gives justice to Mr. Phan and his family.”

Yim’s attorney, Mario Andrews, said he believed the case was a manslaughter. Andrews said his client believed he was in danger of Phan because Phan refused to leave Yim’s house after they fought about God.

Andrews also said that he thought his client could not have premeditated the murder because he was under the influence of alcohol and drugs. The defense attorney said he tried to get a plea deal for his client before trial, but the district attorney’s office would not agree that the case was anything but a first-degree murder.

“We could not come to an agreement so we presented to a jury and the jury made a decision,” Andrews said. “I was hoping for manslaughter.”