LOS ANGELES — A man who fired 50 rounds at a Valley Village memorial gathering, killing four people and wounding two others, was acting in self-defense, his attorney argued, while a prosecutor called it an ambush.

“What happened on April 3, 2010, was an ambush … on an unsuspecting group of friends mourning the loss of a loved one,” Deputy District Attorney Thomas Trainor told the nine-man, three-woman jury during closing arguments.

Nerses Galstyan, 32, is charged with four counts of murder, two counts of attempted murder and one count of mayhem for a victim who lost an eye. He is also facing gun allegations and a special circumstance allegation of multiple murders, making him eligible for a death sentence if he is convicted as charged.

Galstyan took the stand in his own defense and “confirmed that he was the person who walked into the Hot Spot (restaurant) that day and fired 50 rounds,” Trainor said.

It is undisputed that Galstyan shot and killed Hayk Yegnanyan, 25, Sarkis Karadjian, 26, Harut Baburyan, 28, and 31-year-old Vardan Tofalyan, who the defense called Galstyan’s best friend.

The prosecutor said that Galstyan’s claim of self-defense was “the proverbial square peg in the round hole. It doesn’t fit.”

“The entirety of the evidence justifying self-defense comes from the defendant and his brother (Sam Galstyan),” Trainor told jurors.

During trial, Galstyan and his brother testified that Yegnanyan had been pressing Sam to run drugs through his motorcycle club, leading to escalating tension between the three men.

Video from outside the restaurant shows some of what happened prior to the shooting, but lawyers for each side had very different interpretations.

Defense attorney Alex Kessel said that Yegnanyan pulled a knife on Sam Galstyan outside the restaurant prior to the shooting. He said his client defused the situation by picking up Yegnanyan, hoisting him over his shoulder and turning in circles before putting him down.

But Trainor said there was no “famed knife incident,” and that the men weren’t arguing, but engaging in horseplay.

“They were laughing and joking around,” Trainor told jurors.

After Galstyan picked up Yegnanyan, Yegnanyan called Karadjian and Baburyan, who came armed to the memorial gathering, according to Kessel.

“My client, Nerses Galstyan, was the one targeted that day,” Kessel said, telling the jury that Galstyan only fired when Karadjian pulled a gun on him.

Trainor disagreed.

Galstyan “walked in ready to fire, bullet already in the chamber, no safety on,” Trainor told the jurors. He “began firing as he walked in … round after round after round after round .. pausing to reload … stopping only when he ran out of bullets.”

Karadjian “is never able to chamber a round,” according to the prosecutor.    Galstyan aimed for the head with his 9 mm Glock and shot some victims after they had fallen, according to Trainor. As the prosecutor showed pictures of the bloodied victims, some of the family and friends in the courtroom wept or left the room.

“When he brutally executed four people inside the Hot Spot on April 3, 2010, … (it was) not an act of mercy” that some witnesses survived. “They were only spared by a loss of ammunition,” the prosecutor said, asking jurors to find Galstyan guilty of the four murders.

Kessel focused on the prosecution’s lack of motive.

“They’ve had six years,” the defense attorney said. “They can’t give you a reason why something so horrific took place.”

“I know none of you are gonna buy this theory .. everything is hunky dory and (my client) just comes in and starts murdering everybody,” Kessel said to the jurors.

“We told you what happened in that room,” Kessel said. “The people haven’t shown diddly. Zero.”

As for the prosecution’s witnesses, “the people they’re relying on are liars,” Kessel said, pointing out inconsistencies in statements to the police  and in court. “They have an agenda … (have) all been influenced by the family.”

One key witness came forward only after he was indicted for bank fraud and then admitted on the stand that he had lied to police, according to Kessel.

Galstyan was scared of Karadjian, the defense attorney said.

“Sarkis Karadjian is a gangster,” Kessel said, offering a slide showing Karadjian’s tattoos of the numbers 187, the penal code for murder and saying Karadjian had told his client, “I’ve earned my stripes.”

“My client had a gun pointed at him by a guy who was capable of using it,” Kessel said. “If my client didn’t have more than one magazine that day, he would have died.”

He urged the jurors not to be swayed by emotional arguments about the number of rounds, saying the bullets were fired in seconds as Galstyan tried to save himself.

“In California, you don’t have to retreat … you can stand your ground,” Kessel said, telling jurors “the law doesn’t say you’re only entitled to fire 17 rounds … 33 rounds.”

“Those young men died for one reason … because they came in their bravado with firearms to confront someone,” the defense attorney said.

After the shooting, the Galstyan brothers fled to a Seattle, Washington suburb, where they were later arrested, because they were “two scared guys,” Kessel argued, looking for “safety, not for sanctuary.”

Sam Galstyan was not charged in the shooting.