Updated

Trey Anastasio pleaded guilty Friday to a felony drug charge, avoiding jail time in a plea agreement that drops more serious charges and orders him into a drug court program.

Anastasio, 42, pleaded guilty to attempted criminal possession of a controlled substance. He admitted that he was in possession of Vicodin, Percocet, heroin and Xanax when he was pulled over in a Dec. 15 traffic stop in Whitehall.

Under the drug court program, the former Phish frontman will spend 12 to 15 months making weekly court appearances. He will also be subject to drug testing and will have to perform community service.

"He's accepted responsibility," said Washington County District Attorney Kevin Kortright. "That's all we can ask for."

Judge Kelly S. McKeighan postponed sentencing until Anastasio completes the program. If he's successful, Anastasio will be on five years' probation; if not, he could get three years in prison.

"He's committed to this," said defense attorney Stephen Coffey. "He was wrong. He's admitted he was wrong."

Anastasio, who has been performing solo since Phish broke up in 2004, didn't talk to reporters as he walked out of the courthouse and got into a black van.

He lives in New York City but plans to move to the Fort Edward area while he is participating in the drug court program, Coffey said

Anastasio was pulled over by police in Whitehall on Dec. 15. He failed a roadside sobriety test and was charged with possession of a prescription painkiller that belonged to another person, driving under the influence of drugs and driving under the influence of alcohol, which are felonies.

He also was charged with possession of heroin, possession of an anti-anxiety drug prescribed to someone else, and possession of a second prescription painkiller belonging to another person, which are misdemeanors.

Whitehall is 65 miles northeast of Albany on the Vermont line.

After the arrest, Anastasio issued a written statement saying he felt "terrible about what happened last night, and I am deeply sorry for any embarrassment I have caused my friends, family and fans."