Bill Cosby appeared disheveled and out of sorts at a Pennsylvania court Wednesday as he was charged for the alleged sexual assault of a former Temple University employee.

Cosby, 78, stumbled and nearly fell down as he entered the Montgomery County Courthouse around 2:45 p.m. Wednesday. The longtime comedian wore black sweatpants, duck boots and a black and white wool sweater, and carried a cane; on his arm was a young woman.

Cosby yelled, "Not guilty!" as he passed through a sea of reporters on his way into the courthouse. 

Related: Bill Cosby charged with sexual assault of Temple employee

Cosby barely spoke during the arraignment, only giving brief answers to Montgomery County judge Elizabeth McHugh.

"Yes," "yes," "thank you," were Cosby's responses.

He posted $100,000 bail and was ordered not to have any contact with the alleged victim, Andrea Constand.

RELATED: Cosby victim thought drug was 'medicine,' kept silence for a year: docs

"No contact?" Cosby asked at one point, then added, "Yes."

Cosby also turned his passport over to prosecutors before leaving the courtroom, his face set in a grim expression.

He faces three felony counts on aggravated indecent sexual assault for an alleged 2004 rape against Constand, then a Temple University employee.

After the proceedings, which lasted roughly 15 minutes, Cosby was taken to a nearby police station to give his fingerprints and get a mugshot taken.

Cosby is due back in court Jan. 14 for a preliminary hearing. No plea was entered at Wednesday's arraignment.
 
Montgomery County D.A.-elect Kevin Steele announced the charges against Cosby at a press conference in Norristown on Wednesday morning. 
 
Constand reported the alleged rape to law enforcement in 2005, but then-Montgomery County DA Bruce Castor did not prosecute because there was reportedly not enough evidence.
 
Cosby's deposition for a lawsuit filed by Constand over the incident was unsealed in July 2015 after a request from the Associated Press.
 
Steele said the deposition, in which Cosby acknowledged providing drugs to Constand and digitally penetrating her, gave prosecutors sufficient evidence to bring charges against Cosby.
 
Cosby has denied sexually assaulting anyone and said that the encounters were consensual.
 
Constand released a statement through her attorney, Dolores Troiani, on Wednesday reacting to Cosby being charged.
 
“We wish to express our appreciation to the Montgomery County District Attorney’s Office, the county detectives and the Cheltenham Police Department for the consideration and courtesy they have shown Andrea during this difficult time,” the statement said. “We have the utmost confidence in Mr. Steele, Ms. Feden and their team, who have impressed us with their professionalism. In that this matter is now being pursued in the criminal justice system, we will not comment further.”
 
L.A. attorney Gloria Allred, who represents several of Cosby's other alleged victims, also released a statement on the charges Wednesday.
 
“For many of my 29 clients who allege that they are victims of Bill Cosby, seeing him criminally charged and having to face a trial is the best Christmas present they ever received,” Allred said.
 
“So many women who allege that they are victims of Bill Cosby have cried out for justice for so long. In Pennsylvania there is now a journey to justice in the felony case filed against Mr. Cosby. I am very happy that this day has finally come.”
 
Below, see video of Cosby entering magisterial district court in Elkins Park.