Updated

Tekashi 6ix9ine has been ordered to enroll in a mental health program after serving his prison sentence.

The Brooklyn native, whose real name is Daniel Hernandez, will also have to continue to cooperate with U.S. Attorney's Office as part of his plea deal, according to TMZ.

Tekashi was sentenced to two years in a racketeering case earlier this week. He previously pleaded guilty to racketeering and agreed to cooperate with law enforcement. He testified against several members of his Nine Trey Gangsta Bloods gang, which led to other arrests.

RAPPER TEKASHI 6IX9INE’S MOM SAYS SON HAS A ‘BIG HEART,’ BEGS JUDGE TO 'HAVE MERCY' AHEAD OF SENTENCING

The “STOOPID” rapper admitted to helping members of the gang kill a rival gang member in March 2018 as well as taking part in an April 2018 robbery at gunpoint. He also told investigators that he sold a kilo of heroin in 2017, the year he allegedly joined the gang.

In total, he pleaded guilty to nine counts of racketeering, firearms offenses and drug trafficking.

Tekashi 6ix9ine performs at 2018 Power105.1 Powerhouse NYC at Prudential Center on October 28, 2018 in Newark, New Jersey. 

Tekashi 6ix9ine performs at 2018 Power105.1 Powerhouse NYC at Prudential Center on October 28, 2018 in Newark, New Jersey.  (Johnny Nunez/WireImage)

Before Tekashi's sentencing Wednesday, he expressed regret for joining the gang and apologized to his family, his fans and the victims in the case.

TEKASHI 6IX9INE VICTIM SPEAKS OUT AFTER SENTENCING

“I'm not a victim. I put myself in this position from Day One,” he read from a letter. “I made a lot of bad choices in life, but that does not make me a bad person.”

U.S. District Judge Paul Engelmayer told Tekashi, “Your cooperation was impressive. It was game-changing. It was complete and it was brave."

CLICK HERE TO GET THE FOX NEWS APP

Per TMZ, the court did recommend he serve his sentence at a facility close to New York City so his family can visit him more easily.

After his release, Tekashi will be placed on supervised release for five years, required to complete 300 hours of community service, and pay a $35,000 fine.