PITTSFIELD -- A 50-year-old city man who was caught shooting heroin into his IV line while he was a patient at Berkshire Medical Center was sentenced to nine months in jail.

In Central Berkshire District Court on Tuesday, Kenneth Rathbun pleaded guilty to misdemeanor possession of heroin as well as larceny over $250 from an earlier shoplifting case.

Judge Fredric D. Rutberg ordered Rathbun to serve his sentence at the Berkshire County Jail & House of Corrections. Rathbun was given 35 days credit for the time he has served awaiting the outcome of the case.

According to police and prosecutors, a Berkshire Medical Center staffer entered Rathbun's hospital room on March 29, and found him in the process of shooting what he admitted was heroin into the main IV that went to his neck. Rathbun has several visitors in his room at the time. BMC staff and security officers confiscated the drugs and paraphernalia and called police.

Two male visitors took off before police arrived, but 30-year-old Jennifer C. Long, who identified herself as Rathbun's girlfriend, was arrested along with Rathbun.

Rathbun was at the hospital for a large open wound on his arm, allegedly related to drug use. He was medically cleared by BMC staff before being carted off to jail. He had been held on $1,000 since his arrest.

On Tuesday, his arm was still in bandages at his court appearance.

The second case Rathbun pleaded to was from December 2012 and involved shoplifting from a local Walmart.

Rathbun pleaded guilty to the charges as part of a joint recommendation between his lawyer, Julia Allan, and the Berkshire District Attorney's Office.

Long's case remains pending. She is scheduled to be back in court May 21.