Dressed in a prison uniform, Darnell Hagan stood in front of a judge again on Tuesday.

The 36-year-old had already spent a majority of his adult life in prison for drug crimes and an aggravated sexual assault.

A year after his release in 2016, authorities said they became aware that Hagan, an aspiring rapper, was in violation of his parole when he appeared in a YouTube music video in possession of a handgun, drugs, and a large quantity of cash. Police then searched his home in June 2017 and found Hagan in possession of approximately 190 grams of heroin — enough for around 10,000 doses — a handgun and ammunition.

On Tuesday, Hagan, also known as Dashiell McCloud, stood before U.S. District Judge Madeline Cox Arleo to be sentenced after he pleaded guilty in April to a three-count indictment of firearms and drug charges.

Before imposing the sentence, Judge Arleo gave an impassioned plea to Hagan that he needed to change, needed to rehabilitate himself in prison, needed to read every book and take on any job he could during the sentence she would soon hand down. He needed to take time to reflect, Arleo said.

“You will never come out and live a meaningful life unless you fix it,” she said.

And if he didn’t?

“You will die in jail,” Arleo said.

“They’ll cremate you and they’ll send your ashes home,” the judge said. “You are so close to that.”

The plea deal that Hagan agreed to April called for him to be sentenced to 144 to 180 months.

Judge Arleo said she left her chambers Tuesday expecting to sentence Hagan to 180 months in federal prison.

But Hagan’s attorney, John Azzarello, made the case that his client had changed his ways since being arrested in June, realizing he may actually die in prison one day if continued to live how he was.

Hagan told the judge growing up in Newark he was “brainwashed to believe everything was against me.” He dropped out of school in 9th grade and joined the Grape Street Crips when he was 15. Hagan told the judge he wanted a better future. He wanted to support his 15-year-old son and said he feared he may been behind bars when his mother died.

“The lightbulb finally went off,” his attorney said.

Judge Arleo then told Hagan she wanted to give him "a little hope” and sentenced him to 165 months in federal prison.

“Your re-entry starts today,” the judge said. “Not a week after you get out of jail.”

“This is a moment for you to really reflect on over the next few years,” she said.

Hagan was then led out of the Newark courtroom to begin serving the lengthy prison sentence.

Joe Atmonavage may be reached at jatmonavage@njadvancemedia.com. Follow on Twitter @monavage.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.