California Code
CHAPTER 6 - Of Costs
Section 1021.11.

1021.11. (a) Notwithstanding any other law, any person, including an entity, attorney, or law firm, who seeks declaratory or injunctive relief to prevent this state, a political subdivision, a governmental entity or public official in this state, or a person in this state from enforcing any statute, ordinance, rule, regulation, or any other type of law that regulates or restricts firearms, or that represents any litigant seeking that relief, is jointly and severally liable to pay the attorney’s fees and costs of the prevailing party.

(b) For purposes of this section, a party is considered a prevailing party if a court does either of the following:

(1) Dismisses any claim or cause of action brought by the party seeking the declaratory or injunctive relief described by subdivision (a), regardless of the reason for the dismissal.

(2) Enters judgment in favor of the party opposing the declaratory or injunctive relief described by subdivision (a), on any claim or cause of action.

(c) Regardless of whether a prevailing party sought to recover attorney’s fees or costs in the underlying action, a prevailing party under this section may bring a civil action to recover attorney’s fees and costs against a person, including an entity, attorney, or law firm, that sought declaratory or injunctive relief described by subdivision (a) not later than the third anniversary of the date on which, as applicable:

(1) The dismissal or judgment described by subdivision (b) becomes final upon the conclusion of appellate review.

(2) The time for seeking appellate review expires.

(d) None of the following are a defense to an action brought under subdivision (c):

(1) A prevailing party under this section failed to seek recovery of attorney’s fees or costs in the underlying action.

(2) The court in the underlying action declined to recognize or enforce the requirements of this section.

(3) The court in the underlying action held that any provision of this section is invalid, unconstitutional, or preempted by federal law, notwithstanding the doctrines of issue or claim preclusion.

(e) Any person, including an entity, attorney, or law firm, who seeks declaratory or injunctive relief as described in subdivision (a), shall not be deemed a prevailing party under this section or any other provision of this chapter.

(Added by Stats. 2022, Ch. 146, Sec. 2. (SB 1327) Effective January 1, 2023.)