BRICK — A teenager may have shot a group of Brick Memorial High School students back in October as payback for his uncle getting shot in a drive-by shooting days earlier in his neighborhood, investigators revealed.

The accused teen gunman is now facing attempted murder charges as a juvenile. His friend — 16-year-old Luis L. Rivas — pleaded guilty Friday to conspiracy to commit aggravated assault after waiving his right to have the charges against him heard as a juvenile in Family Court.

Rivas faces up to five years in prison when he is sentenced May.

In court on Friday, Rivas denied knowing that his friend was carrying a gun and said that he thought that they were only going to start a fight at the high school, according to a report in the Asbury Park Press, which covered the hearing in Toms River.

The case against the accused gunman, who has not been publicly identified because of his age, remains in Family Court.

The Oct. 22 shooting about a quarter mile away from the campus prompted a school lockdown when a 16-year-old student who had been shot in the shoulder ran back to the school building for help.

The shooting appears to have been retaliation for a drive-by shooting that left a man with a gunshot wound in his leg, according to a township detective's affidavit of probable cause against Rivas. Both Rivas and the juvenile suspect were among the people caught in the drive-by and the man who was shot was identified by the juvenile as his uncle.

New Jersey 101.5 is not naming the adult shooting victim in order to protect the identity of the juvenile suspect who has not been charged as an adult.

That drive-by shooting, meanwhile, may have been sparked by a lovers' quarrel, investigators revealed.

The first shooting happened before midnight on Saturday, Oct. 19, in the Briar Mills housing development.

Police said a group of four underage teens — including the two later charged in the student's shooting — and three men were walking to an apartment when a car pulled up and fired five shots at them.

The man who was shot and his friends were mostly uncooperative with investigators, police said.

But investigators learned that the mother of one of the men in the group had told police that her Cadillac Escalade, parked outside her home, had been vandalized earlier that day. The mother also told police that her son's ex-girlfriend had been sending him threatening messages on Facebook Messenger, including one that said "We on the way" and another saying that she hoped that it was someone he knew that had been shot, according to the affidavit of probable cause.

Another text messages from the ex-girlfriend instructed him to "look a your mother's car."

The shooting near the high school happened days later on Tuesday.

The student victim, who had been walking home with three others, said that before he was shot he noticed two people walking toward them.

Piecing together various surveillance camera images, investigators determined that the two figures had been dropped off by a gold Nissan. Investigators also recognized Rivas and the other teen from the night of the drive-by.

Investigators found surveillance footage showing the Nissan at the housing development and were able to track down the driver, an adult, who told police that he had been driving the teen and Rivas to a store when they told him to pull over near Lanes Mill Road and New York Avenue so that they could talk to some people. The man told police that the teens told him to pull down the block and wait for them.

Police said the man remembers hearing what he thought were gunshots before Rivas came back to his car. He drove away and picked up the other teen, who said that "we evened the score."

The man explained to police that that meant "someone was shot," according to the affidavit.

The man told police that he did not know who had fired the weapon and insisted that the weapon was not in his car.

During questioning on Oct. 23, the teen charged with attempted murder became "visibly upset and started to cry" after investigators showed him surveillance images depicting him on New York Avenue.

The teen said "he got upset over his uncle" getting shot in the leg on Saturday night, police said.

The detective recounted in his affidavit that teen then "became quiet and stated he wanted to go home," and the interview was over.

Enter your number to get the NJ 101.5 app

Sergio Bichao is deputy digital editor at New Jersey 101.5. Send him news tips: Call 609-359-5348 or email sergio.bichao@townsquaremedia.com.