BANGOR, Maine — A key witness in a marijuana smuggling trial that sent a St. David man to federal prison for life was sent back to prison a second time Wednesday for violating his supervised release.

Adam M. Hafford, 43, of Dover-Foxcroft testified in July 2007 against Michael J. Pelletier, 57, of St. David in exchange for immunity against prosecution for being part of Pelletier’s marijuana conspiracy.

Hafford was serving a 10-year sentence on a drug charge when he testified against Pelletier. His sentence was reduced to 4½ years in 2009, and he was released from federal prison on March 10, 2010. Hafford then began serving five years of federal supervised release.

In October, Hafford was sentenced to eight months in federal prison and an additional 4½ years of supervised release for violating his supervised release after he was convicted in Piscataquis County for theft and failed several drug tests. He was ordered to serve the first six months of the new term of supervised release in a Boston halfway house, according to a previously published report.

His most recent violation of supervised release occurred while he was staying at Coolidge House in Boston, according to court documents.

On Wednesday, Hafford admitted that on two separate days in June and July, he was rude with and swore at staff during bed checks at the halfway house.

U.S. District Judge John Woodcock sentenced Hafford to 20 months in federal prison and ended his supervised release. The judge accepted the joint sentencing recommendation of Assistant U.S. Attorney James Moore and defense attorney Charles Hodson II of Bangor.

“My feeling, Mr. Hafford, is that you’ve reached the point where you’ve had enough of the the federal criminal justice system but I also think the federal criminal justice system has had enough of you,” Woodcock told Hafford in imposing the sentence.

Hafford did not address the court.

Hafford testified that in 2004, he ferried cash to Canada and returned with between 60 and 120 pounds of marijuana on his back by “swimming” the St. John River — first wearing a life jacket and later wearing a wetsuit and fins. Hafford, who had never learned to swim, also used a motorized underwater “scooter” to make the passage easier for himself.

He admitted during Pelletier’s trial that he had lied to a federal grand jury in 2006 about just how much marijuana he had smuggled across the border. He admitted that instead of bringing up to 220 pounds of marijuana across the border at a time, he swam with only half that amount on his back.

Pelletier — who is paralyzed from the waist down because of an injury on the family farm when he was a child — is serving a life sentence at the U.S. Penitentiary in Terre Haute, Ind., according to the prisoner locator maintained by the U.S. Bureau of Prisons.