A state appeals court panel has upheld a young man’s conviction for his role in the beating death of a USC graduate student from China who was attacked near campus while walking back to his apartment after a study session.

In a ruling Monday, the three-justice panel from California’s 2ndDistrict Court of Appeal rejected the defense’s contention that there were errors in the trial of Andrew Garcia, who was one of four people convicted of charges stemming from the July 24, 2014, attack on Xinran Ji.

The 24-year-old electrical engineering student was able to stagger away from the attack scene and reached his nearby apartment, where he was found dead by one of his roommates.

“The evidence that Garcia brutally beat Ji during an attempted robbery was overwhelming, supported by surveillance footage of the attack, Garcia’s own statements concerning the robbery, and substantial physical evidence,” the panel noted in its 21-page ruling.

Jurors found Garcia guilty of first-degree murder for Ji’s slaying, along with finding true the special circumstance allegation of murder during an attempted robbery and an allegation that he personally wielded a baseball bat during the attack.

He was also convicted of one count each of robbery, attempted robbery and assault with a deadly weapon for an attack on a man and woman at Dockweiler State Beach about two hours after Ji was targeted.

Garcia — who was 18 at the time of the crime — was sentenced in August 2017 to life in prison without the possibility of parole.

Co-defendants Alberto Ochoa and Alejandra Guerrero — who were 17 and 16 respectively at the time of the crime — were also convicted of first-degree murder, while the getaway driver, Jonathan Del Carmen, pleaded guilty to second- degree murder.

Rose Tsai, a representative for the victim’s parents, told Los Angeles Superior Court Judge George G. Lomeli at Ochoa’s sentencing earlier this year that Ji was “their only child, the joy and pride of their lives and the hope of their future” and that he was senselessly killed.

“The case is finally coming to an end today … However, there will be two persons who will continue to remember him and miss him every day,” Tsai said. “So the only possible consolation for their tremendous suffering and loss will be for this court to render the justice that they hope for.”

In a letter read in court by the prosecutor, USC’s vice president for student affairs wrote that it was “difficult to describe the impact this loss has had on our community.”

“We have waited many years for justice to be done for this terrible crime,” Ainsley Carry wrote. “Because of all of this, we would like to request the most severe sentencing for those who took away the life and shining light of Xinran Ji. The most severe sentencing may provide some consolation to Xinran’s parents and family for their tremendous suffering and loss and we hope such a sentence would deter other criminals from committing such heinous crimes.”

The prosecutor told reporters that the attack on Ji was “incredibly brutal.”

“Mr. Ji suffered through a nightmarish and hellacious beating. The coroner described the blows to his head as blows that he typically sees in high- impact car accidents,” Deputy District Attorney John McKinney said last year, noting that Ji was attacked while walking alone near the campus after walking a fellow student home following a study group meeting.

Ji’s killing occurred two years after two other USC graduate students from China were shot to death during an April 2012 robbery as they sat in a car that was double-parked on a street near the USC campus.

Two men — Javier Bolden and Bryan Barnes — were convicted and sentenced to life in prison without the possibility of parole for the killings of Ying Wu and Ming Qu, who were both 23.