Penal Code 166 is criminal contempt of court — disrupting a courtroom, or willfully disobeying a lawful court order.
It is a misdemeanor, and it turns on whether the disobedience was willful and the order lawful.
What PC 166 Covers
PC 166(a) reaches disorderly or contemptuous behavior during court, breaches of the peace that interrupt proceedings, refusing to be sworn or to answer as a witness, and — most commonly charged — the willful disobedience of a lawful court order.
Disobeying a Court Order
The most common PC 166 case is violating a court order — a stay-away order, a condition of release, or a protective order. Where the order is a domestic-violence protective order, the conduct is often charged instead under PC 273.6. Either way, the prosecution must prove a lawful order, your knowledge of it, and a willful violation.
Penalties and Defenses
PC 166 is generally a misdemeanor. Common defenses: you did not know about the order or its terms; the violation was not willful (accidental or incidental contact); you had no ability to comply; and the order was not lawfully issued — a defendant may challenge the validity of the underlying order. judicial diversion (PC 1001.95) may resolve an eligible case.
Frequently Asked Questions
Is contempt of court a crime in California?
Yes. Criminal contempt under PC 166 is generally a misdemeanor. It covers disrupting a courtroom, refusing to testify, and — most commonly — the willful disobedience of a lawful court order, such as a stay-away or protective order.
What does the prosecution have to prove for PC 166 contempt?
For disobeying an order: that a court lawfully issued the order, that you knew about it, and that you willfully violated it. An accidental violation, or one you had no ability to avoid, does not meet the willfulness requirement.
What is the difference between PC 166 and PC 273.6?
Both punish violating a court order. PC 166 is general criminal contempt; PC 273.6 applies specifically to violating a protective or restraining order, often in the domestic-violence context. Conduct violating a DV protective order is frequently charged under PC 273.6.
GuidesComplete Guide to California Misdemeanors · Glossary · Penalties Reference.
Free 30-Minute Consultation
Contempt often means a court order you didn't fully understand or couldn't follow. Tell me what happened and I'll tell you where it's soft.
Schedule Free ConsultationAbout the Author
Ahmed S. Hasan
San Francisco Criminal Defense Attorney · State Bar of California #364992
Ahmed S. Hasan is the founder of ASH Legal, a solo criminal defense practice based in San Francisco. The firm runs on flat-fee representation: one lawyer, one fee, from arraignment through resolution. No hourly billing. No surprise invoices.
Ahmed is a graduate of Emory University School of Law and a member in good standing of the State Bar of California (Bar #364992). His practice focuses on San Francisco misdemeanor defense — DUI, domestic violence, petty theft and shoplifting, drug possession, vandalism, trespassing, and assault and battery — with particular attention to diversion-track outcomes that end in dismissal under PC 1001.95, PC 1001.36 (Mental Health Diversion), PC 1001.80 (Military Diversion), and PC 1001.83 (Parental Caregiver Diversion).
Ahmed previously served as a post-bar clerk with the San Francisco Public Defender's Office, the city's largest indigent-defense practice. He is a member of the Asian Pacific American Bar Association of Silicon Valley.
He represents clients at the San Francisco Hall of Justice (850 Bryant Street) and the Civic Center Courthouse. The ASH Legal office is at 15 Boardman Place, Suite 301, San Francisco, CA 94103.
Free 30-minute consultations are available by phone or Zoom. (510) 545-6515 · ahmed@ashlegal.com