A teenager who pleaded guilty to his role in a brutal MS-13-connected killing of a 14-year-old girl last spring was sentenced to 50 years in prison Monday.

Prince George’s County Circuit Court Judge Cathy Serrette sentenced Josue Fuentes-Ponce, 17, of Bladensburg, following his October guilty plea to charges of first-degree murder, participating in a gang and conspiracy, according to court records.

Prosecutors and police said Ponce was part of a group of teens that killed Ariana Funes-Diaz after they lured her to a tunnel in Riverdale, Md., on April 18. The teen was ordered to strip naked before being beaten with a baseball bat and slashed with a machete, according to police.

“You set up a vulnerable young girl,” Serrette said, calling the crime the most horrific she has seen on the bench. “You humiliated her. You tortured her. You killed her and left her there.”

The teens conspired to kill Ariana because the group feared she would go to police about a kidnapping and robbery allegedly committed hours earlier in the District, law enforcement said.

Fuentes-Ponce’s attorney asked for leniency, saying he was only 16 at the time of the killing, and psychological testing showed he was operating at the cognitive level of a 9-year-old.

“He’s only 17 years old now,” said Kimberly Righter, a supervising attorney for the Prince George’s County public defender’s office. “A 17-year-old is capable of so much change.”

Ariana reportedly ran away from a youth group home where she had been living in Anne Arundel County before she was killed.

Six days after she was reported missing on April 11, investigators said she was part of a group that kidnapped and robbed a man inside a dark, vacant home on Benning Road in Northeast Washington, according to court documents and three law enforcement officials familiar with the matter.

The man told police he was kicked and beaten with the handle of a machete and told to strip off his shirt to prove he had no gang tattoos. The group later freed him, but during the episode he said a young girl — who the law enforcement officials said was Ariana — had begged for the attack to stop.

The next day, authorities said, Ariana was killed because some members of the group feared she would go to police.

“They decided she needed to die,” prosecutor Stephen Williams said. “The defendant had a machete; his friend had a bat. This was a merciless and brutal killing. He is absolutely culpable for what he has done.”

Authorities said the attack on Ariana was recorded on camera while Joel Escobar, 18, of Northeast Washington, beat her with a wooden bat and Fuentes-Ponce hacked her with a machete.

Escobar has pleaded guilty to the same charges as Fuentes-Ponce and is scheduled for sentencing in February.

Edwin Rios, 19, of Southeast Washington, is set for trial in April on charges of murder, assault, participation in a gang resulting in death and conspiracy to commit murder. Rios is set for trial in April.

County police officials said they discovered Funes-Diaz’s body about a month after the killing in a wooded area in the 6300 block of 64th Avenue, when the police gang unit received information of a possible killing in April.

Prosecutors said a tattoo on her right hand was the only way they could identify her decomposing body after authorities found her facedown in a stream.

Fuentes-Ponce declined to speak at his sentencing.

“I have nothing to say,” he said at one point through an interpreter.

Ariana’s family quietly sobbed through much of the proceedings. Her uncle and mother spoke through an interpreter describing how much they missed her and how devastating her loss has been.

“He doesn’t know how much I’ve been suffering all these months with my daughter,” said Ariana’s mother, who was not identified in court. “Josue is a young boy, but when he killed my daughter, he didn’t pay attention that my daughter was also a child.”