Receive the latest entertainment-news updates in your inbox

In this July 7, 2018, file photo, rapper Tekashi 6ix9ine performs live on stage during a concert at the Huxleys in Berlin, Germany.

Tekashi 6ix9ine, the Brooklyn rapper born Daniel Hernandez, appeared at a New York City courthouse Friday and received his sentence in a child sex case.

E! News confirmed a judge ordered the rapper to serve four years probation and 1,000 hours of community service for violating the terms of a plea agreement stemming from his 2015 arrest for the use of a child in a sexual performance.

He is not required to register as a sex offender but must refrain from gang affiliation and the posting or reposting of online sexually explicit or violent images of women or children.

He previously pled guilty after online videos surfaced of him sexually engaging with an underage girl in October 2015. At the time of the incident, Tekashi 6ix9ine was 18 while the victim was 13.

Tekashi 6ix9ine rose to fame in late 2017 with the release of his debut single "Gummo."

Soon after, he revealed his debut mixtape titled Day68 that debuted at number four on the Billboard 200 album chart. He also got the chance to collaborate with Nicki Minaj who wanted to perform with him at the MTV Video Music Awards.

"I wanted Tekashi [6ix9ine] to perform with me at the VMAs, but somewhere along the lines he did not get approved by the powers that be," she told listeners during an August taping of her Beats 1 Queen Radio show. "When I know somebody, there's nothing you can tell me about them."

Through his legal troubles, Tekashi 6ix9ine has been focused on creating new music as well as expressing gratitude for his supporters.

"10 for 10 THANK YOU TO ALL MY SUPPORTERS," he previously wrote on Twitter.