A Delaware County teen who critically wounded a high school classmate during a botched drug deal has been sentenced to 15 to 30 months in the county prison.

James McCauley, 18, pleaded guilty in March to reckless endangerment, possessing a gun without a license, and receiving stolen property for shooting Marquis Mays, 19, in the face with a stolen handgun in February 2019. He was sentenced during a hearing late Tuesday.

A spokesperson for District Attorney Jack Stollsteimer said that McCauley’s jail time was for the gun conviction, and that he was ordered to serve two years on’ probation after his release for the reckless endangerment conviction.

McCauley was initially charged with attempted murder by then-District Attorney Katayoun M. Copeland. But McCauley’s attorney, A. Charles Peruto Jr., insisted from the beginning that the 18-year-old shot Mays in self-defense after Mays and two other teens tried to rob him during an aborted marijuana deal.

“The prosecutor was reasonable,” Peruto said Wednesday. “I brought her all my evidence, I showed her that this was in fact a planned robbery, arranged well in advance through text messages and conversations with the witnesses.”

McCauley agreed to meet Mays — both were students at Haverford High School — to sell him an ounce of marijuana, according to the affidavit of probable cause for McCauley’s arrest. He brought with him a handgun stolen during an unrelated home invasion, detectives said.

During the transaction, which took place inside a car McCauley borrowed from his mother, Mays and another teen attacked one of McCauley’s friends who was sitting next to them inside the vehicle, prosecutors said. As the fight continued, McCauley fired the .40-caliber handgun he was carrying, striking Mays once in the right side of his face.

The gunshot caused “catastrophic injuries” to Mays, investigators said at the time. He has made a full recovery.