Updated

New York-based rapper Tekashi 6ix9ine scored a huge win Friday when a judge presiding over his child sex case issued him a sentence of four years probation after he pleaded guilty in October 2015 to one count of Use of a Child in a Sexual Performance.

According to court documents obtained by TMZ, Tekashi 6ix9ine, real name Daniel Hernandez, 22, – was at a party in Harlem where a nude 13-year-old girl was taped engaging in sexual acts with another man while Hernandez, who was 18 at the time stood behind the young girl and made “a thrusting motion with his pelvis and smacking on her buttocks."

The facially tattooed rapper's sentence had been deferred for two years and the judge granted him probation on the condition that he received mental health treatment and stayed out of trouble.

Prior to his sentencing, Hernandez had prior arrests for assaulting an officer in Brooklyn, and attacking a fan at a mall in Houston – which he said in a letter to the judge were offenses that didn’t constitute a violation of his plea deal.

In a statement to TMZ, a rep for Hernandez told the outlet, "Daniel understands what he must now do moving forward and we will be with him every step of the way. We also want to thank the judge for being very fair and impartial."

The judge in the rapper’s case credited him for one year of probation, essentially dropping his sentence to three years. He will also have to complete 1,000 hours of community service and refrain from associating with any gang members or involving himself with any gang activity.