Comedian Artie Lange was sentenced to four years of probation, 50 hours of community service and an outpatient rehab program over his arrest for cocaine and heroin possession last year.

Lange, Howard Stern's former sidekick, appeared at Essex County Veterans Courthouse in New Jersey wearing baggy cargo pants, a blue shirt and white sneakers on Friday to be sentenced.

When asked how things went in court, Lange told DailyMail.com: 'Really good. Judge was very fair. I got probation and out-patient program. See what happens.'

Howard Stern’s former sidekick Artie Lange was sentenced to four years of probation, 50 hours of community service and an outpatient rehab program in a New Jersey court on Friday

Lange was arrested in the parking garage outside his Hoboken, New Jersey home in March 2017. Police found cocaine, heroin and drug paraphernalia on him and in his car

Lange, pictured left with a friend, appeared at Essex County Veterans Courthouse in New Jersey wearing baggy cargo pants, a blue shirt and white sneakers on Friday to be sentenced

Lange was first arrested on the drug charges in March 2017 - his mugshot for that arrest is pictured above left. He was arrested again in December (right mugshot) after missing a court date

Lange was arrested in the parking garage outside his Hoboken, New Jersey home in March 2017.

Police found cocaine, heroin and drug paraphernalia on him and in his car.

Lange's lawyer Frank Arleo pleaded with the sentencing judge for his client to avoid prison.

'He has many jobs, he works many, many hours. He supports his mother. He supports many family members and he engages in many charitable events,' Arleo said, according to Radar Online. 'Also judge, he has a diabetes problem and blood pressure problem.

'We request he be given probation with the condition that he attend an outpatient program.

'He knows that if he does not comply with whatever court puts on him as the condition of the probation, then your Honor, the court will put him in jail. He does not want that.

'He has a long life problem, but has indicated that he is going to do his best to try and get himself clean.'

Ahead of his sentencing appearance in court, Lange posted a selfie to Twitter and reflected on his arrest. After he was sentenced, he told DailyMail.com that it went 'Really good. Judge was very fair'

Lange was shock jock Howard Stern's sidekick from 2001 until 2009. They're pictured above together in September 2006

Lange, who has a history of drug abuse, also addressed the court.

The comedian has previously been candid about his drug issues and detailed his addiction to substances such as heroin and cocaine on numerous platforms, including his books Too Fat To Fish and Crash And Burn.

'I apologize for wasting everybody's time, and your time your Honor,' Lange said to the court on Friday. 'Obviously I'm happiest when I work. I support my mom.

'I do a lot of good. But I do have an issue, and I'm trying to take care of it. I do best served doing something outside. And whatever you ask me to do, I'll respectfully do.'

Sentencing judge Nancy Sivilli then delivered Lange's sentencing of four years of probation, 50 hours community service and an out-patient program.

Ahead of his sentencing appearance in court, Lange posted a selfie to Twitter and reflected on his arrest.

He said: 'On my way to my sentencing court date. This is as good as I'm gonna look! I honestly don't know what's gonna happen.

'I've been a good boy and juggled work with recovery. Ive been my mom's only source of income for 30 years… ok. I know. Wahhhh! Ur right. We all got sob stories…

'To tell you the truth the judge has been really fair and patient. The attorneys for the state have been great as well.

'And my attorney Frank Arleo has been oustanding. Im the only scumbag in the group. I'm hoping for the best. But whatever the judge says I will do it like a man..

'So in conclusion let me talk to the blue collar tough kids I grew up with -and I quote "Cmon boys. Let's go say a prayer for a kid who couldn't run as fast as I could". Peace. Artie.'

In December the comedian tweeted a picture of himself with a swollen nose. He said in the caption that he 'fears nothing'

Lange's March 2017 arrest was not the only he faced last year - he was arrested again in December after missing a court date.

He was arrested at his home in Hoboken after failing to appear in Superior Court in Essex County

Lange wrote in a tweet that he missed court because of a 'bad communication' with his lawyer.

Days before the arrest, the comedian tweeted a picture of himself with a swollen nose.

He captioned it: 'Hey I got a quick message for u Ang. U ain't the man. U run for the man. I fear nothing.'

In October 2017, Lange missed a gig in Ohio when he was hospitalized due to medical complications arising from diabetes.

Lange, shock jock Howard Stern's sidekick from 2001 until 2009, fell ill due to elevated sugar levels as result of his condition, TMZ reported, and was advised not to get on a plane.

He was previously hospitalized in April of 2014 in Michigan after he said he went 'into diabetic shock'.