A Virginia Beach man has been sentenced to up to 360 years in prison for his role in a 2008 home invasion.

The Virginian-Pilot reports a judge in Virginia Beach on Wednesday followed a jury’s sentencing recommendation for 22-year-old Richard Richardson Jr.

He was convicted of 40 felonies that included rape, robbery, abduction, forcible sodomy and firearms violations.

Police say Richardson and other defendants planned to rob a drug dealer but ended up in the wrong apartment. Prosecutors say 10 people were celebrating graduation from automotive school when the gunmen arrived.

Another defendant was sentenced earlier to life in prison and a third suspect who was 17 at the time received a 45-year sentence.