NEW YORK — Rapper Tekashi69 was given four years probation Friday stemming from a 2015 arrest on charges of using a child in a sexual performance. On Friday night, police said a bodyguard shot a member of Hernandez's entourage outside a Manhattan restaurant.

The 22-year-old rapper, whose real name is Daniel Hernandez, is required to complete 1,000 hours of community service.

Judge Felicia A. Mennin handed down the sentence Friday, ordering Hernandez to refrain contact with gang members and must not be arrested during the probationary period. If he is found in violation of the plea agreement, he could face 1 to 4 years in prison.

In May 2015, Hernandez was arrested after video surfaced of him engaging in sexual acts with a girl at a party in Harlem. He was 18 years old at the time.

Get Breaking News Delivered to Your Inbox Click here to view related media. click to expand

That October, he pleaded guilty to one count of using a child in a sexual performance. He took a plea agreement that required him to obtain his GED and complete mental health treatment for 2 years.

The agreement also prohibits Hernandez from posting any sexually explicit images of women or children and any images of violence against women or children to his social media accounts.

A request for comment to lawyers representing Hernandez were not immediately returned.

Just before 6 p.m. Friday, a shooting occurred in front of Philippe Chow on the Upper East Side. Police said the victim was part of a group trying to enter the restaurant with Hernandez.

Deputy Inspector Kathleen Walsh said a private security guard fired a licensed gun at a man who had hit him with a chair. The wounded man was hospitalized with non-life-threatening injuries.

Hernandez's attorney, Lance Lazzaro, says his client was not present during the shooting.

Justin Carissimo and Andrea Park contributed to this report.