BANGOR, Maine — A Gouldsboro resident left U.S. District Court a free man Tuesday after a federal judge sentenced him to six months, or time served, for violating his supervised release by smoking marijuana and failing to return to jail on time after a doctor’s appointment.

Jeffrey P. Barnard, 47, hugged his wife, Vicki Barnard, as he left the Margaret Chase Smith Federal Building after a 3½-hour hearing before U.S. District Judge John Woodcock.

Barnard said that he had not expected to be set free after the hearing.

“I thought I would have to serve a little more time, but Judge Woodcock is a fair judge,” he said. “I just want to go home and hug my wife.”

Before the hearing, Vicki Barnard told reporters outside the federal building that Woodcock “needs to have compassion” for her husband. In the courtroom, she begged the judge to send him home to help her pack and move.

“I’m happy it’s going to be over with,” she said outside the courthouse with her arms around her husband’s waist.

At a hearing before being sentenced, Barnard admitted that on two occasions when he had tested positive for marijuana he had denied smoking or ingesting the drug. After hearing testimony from Amie Blanchette, Barnard’s former probation officer, and Barnard, Woodcock found that the defendant had violated his probation by not returning to the jail as ordered.

Barnard testified that he was afraid to return because he had been labeled a “snitch” by corrections officers when he had expressed concern about a safety issue. He turned himself in the next day, defense attorney Marvin Glazier of Bangor told Woodcock.

Under the federal sentencing guidelines, Barnard faced between 18 and 24 months in prison for the violations. The U.S. Office of Probation and Pre-trial Services recommended that Barnard be sent back to federal prison for two years. Assistant U.S. Attorney Gail Malone urged the judge to impose some jail time but did not specify a number of months.

Woodcock said he based his decision on Barnard’s special circumstances, including the recent loss of his left foot and other health problems and his inability to comply with conditions of supervised release.

“Some have tried to frame this as a medical marijuana case of state versus federal law,” the judge said shortly before setting Barnard free. “This is not from my perspective that case at all.”

Woodcock also did not impose another term of supervised release.

“I think you’ve had enough of this system and this system’s had enough of you,” the judge said.

Barnard’s involvement with federal court in Bangor began on Dec. 2, 2000, when he was arrested in his home in Millinocket for being a felon in possession of three firearms. After being found guilty by a jury, Barnard was sentenced to 8 ½ years in federal prison by Woodcock on July 1, 2004.

He was released in January 2009 and began his three-year term of supervised release, Blanchette testified Tuesday. It was set to expire in January 2012.

Barnard’s supporters claimed in the days before the hearing that he raised the ire of federal officials over his refusal to stop smoking marijuana, which he claimed he does to address his myriad medical and pain problems. Barnard has been prescribed pain relief pills but claims they resulted in severe stomach pain and blood in his urine. He said he has been prescribed marijuana by his doctor and is registered with the state as an approved user of medical marijuana, which he said is more effective in addressing his pain problems.

Federal officials have said that Barnard’s federal probation predates Maine’s medical marijuana law and that it explicitly prohibits him from using or possessing alcohol or drugs, according to previously published reports. Barnard tested positive for marijuana 23 times between June 4, 2009, and Dec. 22, 2009, before the state law went into effect, according to federal court documents. Last November, Barnard filed a motion seeking permission to smoke marijuana for medical purposes, but Woodcock denied the request.

Barnard has maintained that several of his medical problems stem from injuries he suffered during prior arrests and during previous stints in jail. Barnard said he has been labeled a snitch by jail officials and as a result has been threatened several times by other inmates.

Barnard has said that in June 2010, concerns about his safety prompted him to jump from a balcony at the Cumberland County Jail to a concrete floor 17 feet below, which resulted in serious injuries to his legs. Since then, Vicki Barnard said earlier this month, his left leg was amputated below the knee and he has had lingering problems with his right leg.

At the end of March, police confiscated 44 marijuana plants from a home in Gouldsboro that Barnard rents with his wife, according to court documents. According to Vicki Barnard, who has not been charged in the incident, the plants were hers and she had a legal right to possess them.

Barnard said she, like her husband, is legally registered with the state as a medical marijuana user and that the plants were hers. She said state law allows such users to possess up to six flowering plants. Only six of the plants confiscated by police from the Barnards were large enough to produce medical marijuana, she said, while the rest were small enough that they do not count toward the state limit.

Left unanswered after Tuesday’s hearing is the legal question of whether federal felons can be sent back to prison for smoking medical marijuana legal under state laws because it violates conditions of their supervised release under federal law.

BDN reporter Bill Trotter contributed to this report.