U.S. comedian Bill Cosby was convicted Thursday of drugging and molesting a one-time friend in 2004, which could send him to prison for the rest of his life.

The 80-year-old Cosby now faces up to 10 years in prison for each of three counts of aggravated assault after a Pennsylvania jury convicted him of an attack on Andrea Constand, now 45. At the time of the assault, she was an administrator for the women's basketball team at Temple University in Philadelphia, Cosby's alma mater.

Cosby, best known as the lovable dad on his 1980's television hit The Cosby Show, was convicted by a jury of seven men and five women after a two-week trial, not quite a year after another jury was unable to reach a verdict on the charges and a mistrial was declared.

Bill Cosby accuser Andrea Constand, center, reacts after the guilty on all counts verdict was delivered in the sexual assault retrial at the Montgomery County Courthouse in Norristown, Pennsylvania, April 26, 2018.

Cosby stared straight ahead when the jury announced its verdict after deliberating 14 hours over two days.

But moments later Cosby lashed out at District Attorney Kevin Steele, calling the prosecutor an "asshole" after he asked that Cosby be immediately jailed because he might flee. The judge, however, decided Cosby could remain free pending sentencing.

A Cosby defense attorney said the entertainer continues to believe he did nothing wrong. "The fight is not over," the lawyer said.

Constand told jurors that Cosby knocked her out with three blue pills he called "your friends." She testified that Cosby penetrated her with his fingers as she lay immobilized, unable to resist or say no.

Cosby's conviction came in one of the first celebrity sexual-assault cases of the MeToo era in the U.S., in which dozens of powerful men in the corporate world, the film industry, media circles and academia have been accused by women of years of repeated behind-the-scenes sexual misconduct.

Attorney Gloria Allred stands with accusers of actor and comedian Bill Cosby after a jury convicted him in a sexual assault retrial at the Montgomery County Courthouse in Norristown, Pennsylvania, April 26, 2018.

Cosby's first trial ended just before women leveled a flood of accusations against the rich and famous, including powerful Hollywood producer Harvey Weinstein, television anchors Matt Lauer and Charlie Rose, and Senator Al Franken. Many of the men apologized for their misconduct, some resigned from their jobs, and others were fired.

In all, more than 60 women have accused Cosby of sexual assaulting them over several decades.

Gloria Allred, a lawyer who represented one of the women who testified against Cosby, said, "We're very, very happy and proud of the result. Women were finally believed. And we thank the jury for that."