BANGOR, Maine — A Jay man who 4½ years ago was shot in the leg by a Maine State Police trooper was sentenced Thursday in U.S. District Court to time served on a federal gun charge.

William C. Burhoe, 55, was sentenced Thursday to four years, one month and 24 days, or time served. He was sentenced after being found competent to stand trial and pleading guilty to possessing a firearm after being involuntarily committed to a mental hospital in 1997, according to his attorney, David Bate of Bangor.

In addition to time served, U.S. District Judge John Woodcock sentenced Burhoe to three years of supervised release.

Burhoe still is facing charges in state court as a result of an incident in the summer of 2006 that also led to the federal charges. He is scheduled to appear Monday before Superior Court Justice Michaela Murphy on state charges of aggravated attempted murder and reckless conduct with a dangerous weapon, according to Woody Hanstein, the Farmington attorney representing Burhoe in state court.

Hanstein said Friday that he expects Burhoe to be found not criminally responsible for the crimes and to be held at Riverview Psychiatric Hospital in Augusta until he is found well enough to be released and not be a danger to himself of others.

Burhoe would be held at the state hospital and receive treatment for at least six months before he would be allowed to apply to spend limited time outside the facility, Hanstein said. No specific date for his release would be set by the judge.

The federal and state charges stemmed from a June 6, 2006, incident when Maine state troopers, Franklin County Sheriff’s Department deputies and Jay police responded to a report that shots had been fired from Burhoe’s Macomber Hill Road home, according to court documents.

Burhoe shot a .270-caliber rifle in the direction of a trooper, according to the U.S. Attorney’s Office, which prosecuted him on the federal charge. The trooper fired one shot at Burhoe and hit him in the leg.

Six weeks later, the Maine Attorney General’s Office ruled the shooting justified.

Burhoe was arrested and charged with aggravated attempted murder and reckless conduct on June 12, 2006, after being released from Central Maine Medical Center in Lewiston. He has been in custody ever since, according to court documents.

He was indicted by a federal grand jury in October 2006 on the federal gun charge, according to Bate. Burhoe has been undergoing treatment at a medical facility run by the U.S. Bureau of Prisons in North Carolina. Twice while Burhoe was held there, Woodcock issued court orders forcing him to take prescribed psychotropic drugs, Bate said.

“It’s been very hard on Mr. Burhoe to be so far away from his family for so long,” Bate said after Friday’s hearing. “But he’s in a much better place now, much more together and it’s nice to see. Support from his family, who were in court today, has been overwhelming. That bodes well for his recovery.”