LOS ANGELES (CNS) - A 21-year-old man was sentenced today to 40 years to life in prison for a shooting that wounded four people outside a Halloween party on the USC campus.

Los Angeles Superior Court Judge Edmund W. Clarke Jr. imposed what a defense attorney called the “minimum” sentence on Brandon Spencer, who was convicted Feb. 10 of four counts of attempted murder stemming from the Oct. 31, 2012, shooting.

The judge noted that if he had run the terms consecutively -- as the prosecution had requested -- rather than concurrently as he wound up doing, the sentence would essentially have been life in prison without the possibility of parole. That is the same punishment Spencer could have potentially faced if the four victims had died, Clarke said.

Just before being sentenced, Spencer pleaded for leniency. He insisted he was “not just some gang-banger” as he had been portrayed during the trial and asked the judge to “give me a second chance at life.”

Spencer cried at several points during the hearing and slammed his head against a table in the courtroom as his sentence was being handed down, prompting sheriff's deputies to move behind him to prevent any further outbursts.

Spencer also lashed out after his conviction in February, shouting expletives in the courtroom and struggling with deputies who managed to handcuff him.  

The prosecution contended that the shooting stemmed from a longstanding feud between Spencer and former CrenshawHigh School football star-turned-gang rival Geno Hall, while the defense maintained that it was a case of mistaken identity.

Deputy District Attorney Antonella Nistorescu told jurors during the trial that Spencer was a “documented, well-known” gang member who had been shot in the stomach in August 2011 by an unidentified rival gang member.

The prosecutor said Spencer was seeking vengeance when he fired at Hall outside the party at USC. Hall testified that he had just been talking to his girlfriend when he was shot and didn't know who did it or why. 

Spencer's attorney, John Blanchard, told jurors during his closing argument, “When you consider all the evidence, the huge inconsistencies and holes ... it's called reasonable doubt, ladies and gentlemen.”

The gunfire broke out near a party sponsored by the Black Student Assembly and attended by about 400 people. Neither Spencer nor any of the four victims were USC students.

The courtroom was packed with Spencer's supporters -- some of whom had written letters to the judge.

But the prosecutor said the issue wasn't Spencer's character, saying the defendant should be sentenced based on his behavior the day of the shooting. She said it was “luck” that no one died as a result of the shooting.  

Spencer's attorney urged the judge to consider his client's future potential. He noted that his client had worked as a licensed security guard and that he had been working toward attending UCLA.

The judge noted that the shooting occurred when the “campus had not yet healed its wounds” from two USC graduate students being shot to death near the campus.

Blanchard -- who has cited what he said were contradictory statements by the three eyewitnesses -- filed a notice appealing his client's conviction. 

Outside court, Spencer's father, James, said his son had been railroaded. 

“It wasn't a fair trial. It was a kangaroo court,” he told reporters.  “I was naive about this justice system.”

Spencer's attorney said outside court that his client “got the minimum” sentence and could have faced as much as 160 years to life in prison.

“It was the best result we could hope for,” Blanchard said of the sentence, while noting that he was disappointed with the verdict.