A man charged with the beating death of a Chinese student at the University of Southern California was sentenced to life in prison on Friday without the possibility of parole.

Alberto Ochoa, 22, was the last of four suspects to be tried for the 2014 murder of 24-year-old engineering student Xinran Ji.

According to prosecutors, Ji was walking home from a study group on July 24, 2014, when three young men and a 16-year-old girl attacked him, beating him with a baseball bat and wrench as they tried to rob him.

Ji managed to flee and staggered back to his campus apartment, where he was found dead hours later by a roommate.

Prosecutors said Ji was targeted because he was Chinese and his attackers assumed he had money.

Ji's parents travelled several times to Los Angeles for the trials.

"He was our only child and we lost him," the parents told the court in a statement read by one of their attorneys at a sentencing hearing for one of the defendants in 2017. "From that day, we lost the sunshine in our lives."

Apart from Ochoa, two of the other suspects in the case, including the female, have been sentenced to life in prison without the possibility of parole.

The fourth suspect, the getaway driver, pleaded guilty to second-degree murder and was sentenced to 15 years to life in prison.

Ji's killing took place two years after two other USC students from China were shot to death during a robbery as they sat in a car.

The violence prompted the university, located near downtown Los Angeles, to boost security.

About half of USC's international student population of 11,300 are from China, according to the school's website.