Edgar Maldonado, 21, and Eddy Lopez, 17, both pleaded no contest to attempted murder, admitted personal use of a firearm, and a gang enhancement for the June 2009 shooting, the district attorney's office said.
Maldonado was sentenced to 21 years in prison and Lopez to 19 years. Lopez was tried as an adult due to the serious nature of the crime, the district attorney's office said.
During the shooting, the pair got out of a car and fired at the victim with a handgun and a shotgun.
The handgun shots missed, but the victim was hit by the shotgun blast from his neck down to his lower leg, the district attorney's office said.