Penal Code section 171.7


(a)

For purposes of this section:

(1)

“Public transit facility” means any land, building, or equipment, or an interest therein, including a station on a public transportation route, to which access is controlled in a manner consistent with the public transit authority’s security plan, whether or not the operation thereof produces revenue, that has as its primary purpose the operation of a public transit system or the providing of services to the passengers of a public transit system. A public transit system includes the vehicles used in the system, including, but not limited to, motor vehicles, streetcars, trackless trolleys, buses, light rail systems, rapid transit systems, subways, trains, or jitneys, that transport members of the public for hire.

(2)

“Firearm” has the same meaning as specified in subdivisions (a) and (b) of Section 16520.

(b)

It is unlawful for a person to knowingly possess any of the following in a public transit facility:

(1)

A firearm.

(2)

An imitation firearm as defined in subdivision (a) of Section 16700.

(3)

An instrument that expels a metallic projectile, such as a BB or pellet, through the force of air pressure, CO2 pressure, or spring action, or a spot marker gun or paint gun.

(4)

A metal military practice hand grenade.

(5)

A metal replica hand grenade.

(6)

A plastic replica hand grenade.

(7)

An unauthorized tear gas weapon.

(8)

An undetectable knife, as described in Section 17290.

(9)

An undetectable firearm, as described in Section 17280.

(c)

(1)Subdivision (b) does not apply to, or affect, any of the following:

(A)

A duly appointed peace officer as defined in Chapter 4.5 (commencing with Section 830) of Title 3 of Part 2.

(B)

A retired peace officer with authorization to carry concealed weapons as described in Article 2 (commencing with Section 25450) of Chapter 2 of Division 5 of Title 4 of Part 6.

(C)

A full-time paid peace officer of another state or the federal government who is carrying out official duties while in California.

(D)

A qualified law enforcement officer of another state or the federal government, as permitted under the Law Enforcement Officers Safety Act pursuant to Section 926B or 926C of Title 18 of the United States Code.

(E)

A person summoned by an officer listed in subparagraphs (A) to (C), inclusive, to assist in making arrests or preserving the peace while they are actually engaged in assisting the officer.

(F)

A person who is responsible for the security of the public transit system and who has been authorized by the public transit authority’s security coordinator, in writing, to possess a weapon specified in subdivision (b).

(G)

A person possessing an unloaded firearm while traveling on a public transit system that offers checked baggage services, so long as the firearm is stored in accordance with the public transit system’s checked baggage policies.

(2)

Paragraph (7) of subdivision (b) does not apply to or affect the possession of a tear gas weapon when possession is permitted pursuant to Division 11 (commencing with Section 22810) of Title 3 of Part 6.

(3)

Paragraph (1) of subdivision (b) does not apply to a person transporting an unloaded firearm locked in a lock box in compliance with paragraph (8) of subdivision (a) of Section 26230.

(d)

A violation of this section is punishable by imprisonment in a county jail for a period not exceeding six months, or by a fine not exceeding one thousand dollars ($1,000), or by both that fine and imprisonment.

(e)

The provisions of this section are cumulative and do not restrict the application of any other law. However, an act or omission that is punishable in different ways by this and any other provision of law shall not be punished under more than one provision.

(f)

This section does not prevent prosecution under any other provision of law that may provide a greater punishment.

(g)

This section shall be interpreted so as to be consistent with Section 926A of Title 18 of the United States Code.

Source: Section 171.7, https://leginfo.­legislature.­ca.­gov/faces/codes_displaySection.­xhtml?lawCode=PEN§ionNum=171.­7.­ (updated Jan. 1, 2026; accessed Dec. 29, 2025).

Green check means up to date. Up to date

Verified:
Dec. 29, 2025

§ 171.7's source at ca​.gov