The same day Artie Lange’s Twitter account announced he had entered a “long-term treatment program,” the New Jersey comedian reported to Essex County Jail after testing positive for cocaine for the second time in less than two months.

Lange, 51, was booked into the jail on Wednesday. In a mug shot, his nose, flattened after years of drug abuse, appears to have been bleeding.

The comedian had not been sentenced to jail, but was due to report to drug court at state Superior Court in Newark, where he was given a drug test. Just weeks after Lange tested positive for cocaine, in violation of his probation, he tested positive for the drug again, says his lawyer, Frank Arleo. The drug court has the authority to remand Lange to jail.

Arleo says that Lange, who is on Suboxone, a medication used to treat opioid dependence, also tested positive for morphine.

“He knows he’s got a problem," Arleo says. “He knows he shouldn’t have tested dirty yesterday, but he did. He knew what was going to happen.”

Lange, who is best known for his more than eight years as an on-air personality for “The Howard Stern Show," just resumed his recurring role on the HBO series “Crashing,” last appearing in the show’s season three premiere on Jan. 20.

Excuse any show advertisements.. starting today, Artie will be undergoing a long term treatment program, he loves and respects his fans... updates coming soon.. and it’s time - TeamLange — Artie Lange (@artiequitter) January 30, 2019

Arleo says Lange could be at Essex County Jail through at least Feb. 6, when his case is due to be reevaluated. He expects the comedian will be moved to an inpatient drug treatment program.

“The issue will be finding a bed at an inpatient facility," Arleo says.

Katherine Carter, spokeswoman for the Essex County Prosecutor’s Office, says Lange was originally supposed to enter a drug court program in Essex County and be moved to Hudson County, closer to his Hoboken home.

A tweet posted to Lange’s account on Wednesday night did not make any mention of the comedian’s incarceration.

“Excuse any show advertisements.. starting today, Artie will be undergoing a long term treatment program, he loves and respects his fans... updates coming soon.. and it’s time,” read the tweet, signed by “TeamLange.”

Lange has acknowledged many “last chances” over the past year, but for the most part, he managed to evade jail.

In December, Lange, who had been sentenced to four years of probation for heroin possession in June, tested positive for cocaine at a court appearance after a short stint in rehab, but avoided a penalty of up to five years in jail for the violation of his probation. Instead, Judge Nancy Sivilli recommended Lange, who grew up in Union, for drug court. He had already been in court for alleged probation violations — having tested positive for drugs — when the additional violation came to light. But both the judge and Lange’s lawyer seemed to agree that his addiction would not be helped by time in jail.

Lange, who has struggled with drug addiction for decades, moving in and out of rehab programs and hospitals, was charged with heroin possession in connection with a May 2017 arrest, when State Police found him with 81 decks of heroin on the Garden State Parkway. He was last jailed in Essex County in December 2017, when he failed to show up in court for the heroin charge. He later pleaded guilty to heroin possession.

“I wouldn’t be arrogant enough to come in here after using cocaine for two days,” Lange told Sivilli at his December court appearance, after a prosecutor said test results indicated that Lange had used cocaine within a few days of his court date. “It’s in my system and it shouldn’t be.”

When he was first sentenced, Lange asked that Sivilli recommend him for an outpatient drug treatment program so he could keep working and support his mother. A prosecutor warned that Lange’s life would be at risk if he didn’t enter an inpatient treatment program. Sivilli ordered Lange to enroll in an outpatient program and complete community service in addition to his four years of probation. Lange told NJ Advance Media that he had been fulfilling his community service hours by performing comedy at a Hoboken senior center.

“The judge and Prosecutor were unbelievably compassionate,” Lange tweeted after his December appearance for probation violations, saying he realized drug court would be his last chance to stay out of jail. “I’m not high. So I see it clearly now. They wanna save my life. 10 days ago when I left rehab I had to touch the flame," he said, referring to his brush with cocaine. Lange said the fact that he hadn’t used heroin during that time was a personal victory, though he was also on Suboxone to prevent him from getting high off the drug.

“I have work to do,” Lange continued, as part of a series of tweets. “I feel now I can also stop Cocaine. But that’s arrogance and addiction. I’m accepting help. If I fail now I will go to jail. Jail is not for addicts. But I’d be giving them no choice. When I use illegal drugs I have to score them. That’s breaking the law.”

The comedian’s nose has a deflated appearance because his septum has been demolished after his long history of snorting heroin and cocaine (and, on one occasion, inadvertently snorting OxyContin mixed with broken glass).

Lange, who has said his addictions include gambling, recently told the "Are We Still Talking About This?” podcast that his nose’s current state is also the result of a man punching him in the face about a year ago. The teen had been collecting money for a bookie that Lange owed $62,000. He said the person who knocked him out threatened him and demanded $100,000, but ultimately left him alone.

Update, Feb. 1: This post has been updated to remove incorrect information from the prosecutor‘s office stating that Lange could not be transferred because he tested positive for drugs. In fact, Lange must complete residential treatment before being transferred.

Have a tip? Amy Kuperinsky may be reached at akuperinsky@njadvancemedia.com. Follow her on Twitter @AmyKup or on Facebook.

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