BAKERSFIELD, Calif. (KGET) — In July of last year, Raymond Rojas used a vehicle to block a car parked at an auto parts store in Oildale then pointed a gun at the driver and demanded money.

When he didn’t comply, Rojas fired a shot, hitting the man in the leg and shattering his femur, prosecutors said.

Rojas, 33, was sentenced Tuesday to 40 years and three months in prison following his conviction on eight felonies including robbery and shooting at an occupied motor vehicle, possession of a stolen vehicle and gun-related offenses.

The shooting happened July 17 at an O’Reilly Auto Parts store.

Rojas has prior convictions for assault with a deadly weapon, grand theft and spousal battery, according to court records.