California Penal Code 171 – Weapons in Public Buildings
California Penal Code Section 171 makes it a crime to bring certain weapons into public buildings or public meetings. The law is intended to protect government facilities, public officials, employees, and members of the public from dangerous weapons inside government-controlled locations.
Weapon charges involving public buildings can result in misdemeanor or felony consequences, depending on the type of weapon involved, the circumstances of the case, and a person's criminal history.
Many people are surprised to learn that carrying otherwise lawful weapons into restricted government locations may still violate California law. Even individuals with concealed carry permits or legal firearm ownership rights may face criminal charges in some situations.
If you were arrested or investigated for possessing a weapon in a public building under California Penal Code 171, understanding the law, possible defenses, and potential penalties is critical.
Our California criminal defense lawyers at Eisner Gorin LLP represent clients facing firearm and weapons charges throughout California. Schedule your consultation by calling (818) 781-1570 or using the contact form.
What Is California Penal Code Section 171?
California Penal Code Section 171 prohibits bringing certain weapons into:
- State or local public buildings
- Public meetings open to the public
- Government offices
- Courthouses and government facilities
- Legislative meetings and public agency meetings
The statute is designed to reduce risks involving violence or threats inside government-controlled environments.
Weapons prohibited under Penal Code 171 may include:
- Firearms
- Knives and certain blades
- Tasers or stun guns in some situations
- Explosive devices
- Other dangerous weapons prohibited by law
What Is Considered a Public Building?
Under California law, a public building generally refers to buildings owned or occupied by state or local government entities.
Examples may include:
- City halls
- Courthouses
- Police stations
- County offices
- Government administration buildings
- Public agency offices
- Legislative buildings
Public meetings may include:
- City council meetings
- School board meetings
- Public commission hearings
- Government committee meetings
The law may apply even if the meeting occurs in a privately owned building, provided the meeting is open to the public and conducted by a government body.
What Weapons Are Prohibited Under Penal Code 171?
The law prohibits several categories of dangerous weapons in public buildings and meetings.
Firearms
Loaded and unloaded firearms may both violate Penal Code 171 if brought into prohibited locations.
Knives and Bladed Weapons
Certain knives, dirks, daggers, or other prohibited blades may result in criminal charges.
Explosives and Destructive Devices
Explosive devices, bombs, and destructive weapons are heavily restricted and may lead to additional felony charges.
Other Dangerous Weapons
Depending on the circumstances, prosecutors may allege violations involving:
- Stun guns
- Tasers
- Metal knuckles
- Concealed dangerous weapons
Elements Prosecutors Must Prove
To convict someone under Penal Code 171, prosecutors generally must prove:
- The defendant brought or possessed a prohibited weapon
- The weapon was brought into a public building or public meeting
- The defendant knew they possessed the weapon
- The conduct was unlawful under California law
Knowledge and intent issues may become important in many cases.
Exceptions Under California Penal Code 171
Certain individuals and situations may qualify for exceptions under the statute.
Possible exceptions may include:
- Peace officers acting within official duties
- Authorized security personnel
- Military personnel in lawful performance of duties
- Individuals specifically authorized by law
Even individuals with concealed carry permits may still face restrictions depending on the location and applicable laws.
Penalties for Violating California Penal Code 171
| Violation | Potential Criminal Penalties | Possible Additional Consequences |
|---|---|---|
|
Bringing a Firearm Into a Public Building |
Misdemeanor or felony charges, jail or prison time, and fines |
Loss of firearm rights and permanent criminal record |
|
Possessing a Prohibited Knife in a Government Building |
Possible misdemeanor penalties including county jail and probation |
Employment and professional licensing consequences |
|
Bringing a Weapon to a Public Meeting |
Criminal charges and possible probation or incarceration |
Restrictions on future firearm ownership |
|
Possession of Explosive or Destructive Devices |
Serious felony charges and state prison exposure |
Federal investigations and enhanced penalties |
|
Repeat Weapons Offenses |
Increased sentencing exposure and harsher penalties |
Greater risk of felony prosecution |
|
Weapons Conviction Involving Firearms |
Possible firearm prohibitions under California and federal law |
Inability to lawfully possess or purchase firearms |
|
Felony Weapons Conviction |
State prison sentence and substantial fines |
Immigration consequences and voting rights restrictions |
|
Probation Sentence |
Court supervision with conditions and restrictions |
Search conditions and compliance requirements |
|
Violation While on Probation or Parole |
Additional criminal penalties and possible revocation proceedings |
Increased custody exposure |
|
Weapons Conviction Affecting Immigration Status |
Possible immigration detention or deportation risks |
Visa, residency, or citizenship complications |
Factors That May Affect Penal Code 171 Penalties
Several factors may influence the severity of penalties under California Penal Code 171, including:
- Type of weapon involved
- Whether the weapon was loaded or operable
- Prior criminal history
- Location of the alleged offense
- Presence of aggravating circumstances
- Whether the defendant qualifies for a statutory exemption
- Whether the offense involved additional criminal allegations
Every weapons case is different, and the potential penalties depend heavily on the facts, evidence, and legal defenses involved.
Firearm Restrictions After a Conviction
A conviction involving weapons in public buildings may trigger additional firearm restrictions under California law.
Potential consequences may include:
- Loss of firearm ownership rights
- Restrictions on concealed carry permits
- Future firearm purchase prohibitions
- Federal firearm disabilities in felony cases
The impact depends heavily on the specific offense and whether the conviction is classified as a misdemeanor or felony.
Common Defenses to Penal Code 171 Charges
Several defenses may apply in public building weapons cases depending on the facts.
Lack of Knowledge
The defense may argue the defendant did not know the weapon was present or did not knowingly bring it into the building.
Lawful Authorization
Some defendants may qualify for statutory exemptions involving law enforcement, security work, or authorized duties.
Illegal Search and Seizure
If law enforcement violated constitutional protections during a search, the defense may seek suppression of evidence.
Weapon Does Not Qualify Under the Statute
The defense may challenge whether the item legally qualifies as a prohibited weapon under Penal Code 171.
No Intentional Entry Into Restricted Area
In some situations, accidental entry into a restricted government location may become relevant to the defense.
Related California Weapons Laws
California Penal Code 25400 – Carrying a Concealed Firearm
Penal Code 25400 prohibits carrying a concealed firearm on a person or inside a vehicle without lawful authorization.
California Penal Code 25850 – Carrying a Loaded Firearm in Public
Penal Code 25850 prohibits carrying a loaded firearm in public places or inside vehicles under certain circumstances.
California Penal Code 626.9 – Gun-Free School Zone Act
Penal Code 626.9 makes it illegal to possess firearms in designated school zones unless a legal exception applies.
California Penal Code 171b – Bringing Weapons Into Public Buildings and Meetings
Penal Code 171b prohibits bringing certain weapons into public buildings, government offices, and public meetings.
California Penal Code 417 – Brandishing a Weapon
Penal Code 417 prohibits drawing, exhibiting, or using a weapon in a threatening, angry, or unlawful manner in the presence of another person.
Examples of Penal Code 171 Violations
Example 1: Firearm at a City Council Meeting
A person enters a public city council meeting while carrying a concealed firearm without lawful authorization. Security personnel discover the weapon during screening, and law enforcement files charges under Penal Code 171.
Example 2: Knife in a Government Building
An individual enters a county administration building carrying a prohibited knife inside a backpack. Prosecutors later allege the weapon violated California public building weapons laws.
Every case depends on the specific facts, type of weapon, and circumstances involved.
Potential Consequences of a Weapons Conviction
Weapon convictions can create serious long-term consequences beyond criminal penalties.
Potential consequences may include:
- Permanent criminal record
- Loss of firearm rights
- Immigration consequences
- Employment difficulties
- Professional licensing issues
- Increased penalties for future offenses
Because weapons offenses may carry severe collateral consequences, early legal representation is important.
Frequently Asked Questions
What does California Penal Code 171 prohibit?
California Penal Code 171 prohibits bringing certain weapons into public buildings and public meetings.
Can someone carry a firearm into a government building?
Generally, no. Firearms are heavily restricted in government buildings and public meetings under California law, even for some permit holders.
What qualifies as a public building?
Public buildings typically include government-owned or government-operated buildings such as courthouses, city halls, county offices, and police stations.
Is carrying a knife into a public building illegal?
Certain knives and prohibited blades may violate Penal Code 171 depending on the type of knife and circumstances involved.
Is Penal Code 171 a felony?
Violations may be charged as misdemeanors or felonies, depending on the facts, the weapon involved, and the defendant's criminal history.
Are there exceptions for law enforcement officers?
Yes. Peace officers and certain authorized individuals acting in the performance of official duties may qualify for statutory exemptions.
What if someone accidentally brought a weapon into a government building?
Lack of knowledge or accidental possession may become important defenses depending on the circumstances.
Can a conviction affect firearm rights?
Yes. A conviction may lead to restrictions on firearm ownership and limitations on concealed carry.
Can evidence be suppressed in a weapons case?
Yes. If law enforcement violated constitutional rights during a search or seizure, the defense may seek to suppress the evidence.
Why should someone hire a California weapons defense lawyer?
An experienced criminal defense attorney can challenge unlawful searches, evaluate statutory defenses, negotiate reduced charges, and protect constitutional rights throughout the case.
Speak With a California Weapons Defense Lawyer
If you were arrested or investigated for bringing a weapon into a public building or public meeting under California Penal Code 171, obtaining experienced legal representation immediately is critical.
Weapon charges can carry serious criminal penalties and long-term consequences, including impacts on firearm rights, immigration status, employment opportunities, and professional licensing.
A California weapons defense lawyer can help:
- Analyze the evidence against you
- Evaluate possible defenses and exemptions
- Challenge unlawful searches or seizures
- Seek dismissal or reduced charges
- Protect your constitutional rights throughout the case
Our California criminal defense attorneys represent clients facing misdemeanor and felony weapons charges throughout the state and aggressively defend against firearm and public building weapons allegations.
Contact an experienced California weapons defense attorney today to review your case and explore your legal options. Eisner Gorin LLP is ready to assist. Book your consultation now. Our firm is located in Los Angeles.

If you have one phone call from jail, call us! If you are facing criminal charges,