Under California law, harassment is defined in Code of Civil Procedure Section 527.6 as one of three things: unlawful violence such as assault, battery, or stalking; a credible threat of violence; or a knowing and willful course of conduct directed at a specific person that seriously alarms, annoys, or harasses them, serves no legitimate purpose, and would cause a reasonable person to suffer substantial emotional distress. That civil definition is the anchor, but the legal definition of harassment in California also reaches into the Penal Code, where specific behaviors like stalking, criminal threats, and repeated harassing communications are crimes, and into the Government Code, where workplace harassment based on protected characteristics has its own separate definition under the Fair Employment and Housing Act.
The Three Categories of Civil Harassment
Section 527.6 organizes harassment into three distinct categories, and understanding which one applies matters because the proof required is different for each.1California Legislative Information. California Code of Civil Procedure 527.6 – Injunctions Prohibiting Harassment
The first category is unlawful violence: any assault, battery, or stalking. A single incident is enough. The second is a credible threat of violence, meaning a statement or pattern of behavior that would place a reasonable person in fear for their safety or their family’s safety and that serves no legitimate purpose. The person making the threat does not need the immediate ability to carry it out; what matters is whether a reasonable person would take it seriously.
The third category is where most disputes actually land: a knowing and willful course of conduct directed at a specific person. “Course of conduct” means a pattern of acts over a period of time, however short, showing a continuous purpose. It includes following someone, making harassing phone calls, and sending harassing messages by mail, email, or any other electronic means.1California Legislative Information. California Code of Civil Procedure 527.6 – Injunctions Prohibiting Harassment A single rude encounter or one insulting message will not qualify.
Two requirements catch people off guard in this third category. The conduct must be objectively bad enough that a reasonable person would suffer substantial emotional distress, and it must actually have caused that level of distress to the specific person bringing the case. Both the objective and subjective pieces have to be there.
One important carve-out sits inside the statute itself: constitutionally protected activity is expressly excluded from “course of conduct.” Speech on public issues and other First Amendment activity cannot be the basis of a harassment claim, even when the target finds it deeply upsetting.
When Harassment Becomes a Crime
The civil definition covers the ground where a victim wants a restraining order. Prosecutors work from a different set of statutes, and the same behavior can trigger criminal charges when it crosses specific lines drawn by the Penal Code.
Stalking
Penal Code Section 646.9 defines stalking as willfully, maliciously, and repeatedly following or harassing someone while making a credible threat intended to place the person in reasonable fear for their safety or their family’s safety. A first offense is a “wobbler,” meaning it can be charged as a misdemeanor (up to one year in county jail and a fine of up to $1,000) or as a felony carrying a state prison sentence.2California Legislative Information. California Penal Code 646.9 – Stalking
Penalties jump in two situations. If a restraining order or other court order was already in effect against the defendant, stalking becomes a straight felony punishable by two, three, or four years in prison. If the defendant has a prior felony for domestic battery, violating a protective order, or criminal threats, a stalking conviction carries two, three, or five years in prison. A felony stalking defendant may also be required to register as a sex offender.
Criminal Threats
Under Penal Code Section 422, criminal threats are threats to kill or cause great bodily injury to another person, whether spoken, written, or electronic. The threat has to be specific and immediate enough to communicate a serious intent, and the target must actually experience sustained fear (more than momentary) that is reasonable under the circumstances.3California Legislative Information. California Penal Code 422 – Criminal Threats Criminal threats is also a wobbler. A felony conviction counts as a strike under California’s Three Strikes law.
Harassing Calls and Messages
Penal Code Section 653m makes it a misdemeanor to contact someone by phone or electronic device with intent to annoy while using obscene language or threatening injury. It is separately a misdemeanor to repeatedly call or electronically contact someone with intent to annoy or harass, whether or not a conversation ever happens.4California Legislative Information. California Penal Code 653m – Annoying or Harassing Communications Good-faith communications and legitimate business contacts are excluded.
Cyber Harassment
Penal Code Section 653.2 targets a specific online tactic: posting someone’s personal information or a harassing message about them electronically, intending to make them fear for their safety and intending to cause a third party to harm or harass them. It is a misdemeanor punishable by up to one year in county jail, a fine of up to $1,000, or both.5California Legislative Information. California Penal Code 653.2 – Electronic Cyber Harassment
Workplace Harassment Has Its Own Definition
Harassment at work is not defined by Section 527.6. It falls under Government Code Section 12940, part of California’s Fair Employment and Housing Act, which makes it unlawful for employers, labor organizations, and individuals to harass employees, applicants, unpaid interns, or contractors based on protected characteristics including race, sex, gender identity, sexual orientation, religion, national origin, disability, and age.6California Legislative Information. California Government Code 12940 – Unlawful Employment Practices The list of protected categories is broader than federal Title VII, and FEHA applies to employers with as few as one employee for harassment claims.
FEHA imposes personal liability on individual harassers regardless of whether the employer knew what they were doing. Employers are automatically liable for harassment by supervisors. For harassment by coworkers or nonemployees such as customers and vendors, the employer is liable if management knew or should have known and failed to take immediate corrective action. Employees do not need to show they lost a job or a promotion; the harassment itself is enough. FEHA also imposes no cap on damages, unlike federal Title VII.
Workplace harassment claims go to the California Civil Rights Department (formerly the Department of Fair Employment and Housing), and the deadline is three years from the last incident.
Restraining Orders for Harassment
The main civil remedy is a harassment restraining order under Section 527.6. It is available when the person harassing you is not a spouse, close family member, dating partner, or other close relation; those situations go through the Family Code as domestic violence restraining orders instead. Section 527.6 is the tool for neighbors, coworkers, acquaintances, and strangers.1California Legislative Information. California Code of Civil Procedure 527.6 – Injunctions Prohibiting Harassment
You file a petition in the superior court in the county where you live, where the person you are filing against lives, or where the harassment occurred.7California Judicial Branch. The Restraining Order Process for Civil Harassment Cases A judge reviews it and can grant a temporary restraining order the same day without the other side present. The temporary order lasts up to 21 days, or 25 days if the hearing is extended. At the hearing, both sides can present evidence and witnesses. If the petitioner proves the case, the judge can issue an order lasting up to five years, prohibiting contact, requiring the person to stay away from home, work, or school, and barring the conduct that led to the petition.
If the order does not specify an expiration, it defaults to three years. You can renew it for up to five more years without showing any new harassment, but the renewal request has to be filed within the three months before the current order expires. Let it lapse and you start over.
Penalties for Violating a Restraining Order
Ignoring a harassment restraining order is a crime under Penal Code Section 273.6. A knowing and intentional violation is a misdemeanor punishable by up to one year in county jail, a fine of up to $1,000, or both.8California Legislative Information. California Penal Code 273.6 – Violation of Protective Order If the violation causes physical injury, the minimum jail time is 30 days and the maximum fine doubles to $2,000. A second conviction within seven years involving violence or a credible threat of violence can be charged as a felony carrying a state prison sentence. A second conviction within one year that causes physical injury carries a minimum of six months in jail.
Common Defenses to a Harassment Claim
A person accused of harassment has real defenses, and the strongest ones aim directly at the elements the petitioner or prosecutor has to prove.
The “no legitimate purpose” element in the civil statute is often where cases turn. A landlord serving eviction notices, a process server making repeated attempts at the door, or a journalist asking questions on a matter of public concern is doing something with a recognizable purpose beyond causing distress. Context matters: the relationship between the parties, the nature of the contacts, and whether the behavior fits any legitimate role.
On the criminal side, mental state is often the pressure point. Criminal threats requires proof the defendant intended the statement to be understood as a threat. Stalking requires willful, malicious conduct. If the state cannot establish the required intent, the charge falls apart.
Free speech is an explicit defense. Section 527.6 removes constitutionally protected activity from the definition of “course of conduct,” and California’s anti-SLAPP statute, Code of Civil Procedure Section 425.16, lets a defendant move early to strike a lawsuit arising from protected speech or petitioning activity. A successful anti-SLAPP motion dismisses the case and requires the plaintiff to pay the defendant’s attorney fees and costs.9California Legislative Information. California Code of Civil Procedure 425.16 – Special Motion to Strike
Emotional distress is also open to challenge. A defendant can argue that a reasonable person would not have been substantially distressed by the conduct, or that the plaintiff was not actually distressed to that degree. Medical records, therapy notes, and testimony from people who saw the plaintiff during the relevant period all become evidence. When the alleged behavior reads as merely annoying rather than seriously distressing, courts are unlikely to find harassment.