*553Defendant and appellant Jasmine Nicole Richards appeals from the judgment following a jury trial in which she was convicted of one count of attempting to take another person from the lawful custody of *97a peace officer by means of a riot in violation of Penal Code sections 405a and 664.1 Imposition of sentence was suspended and Richards was placed on probation, including a condition of 90 days in county jail.
Richards was a participant in a "Black Lives Matter" demonstration on August 29, 2015. During the demonstration, several demonstrators, including Richards, attempted to prevent police officers from arresting a suspect, Benita Escoe, who had been involved in an earlier altercation at a restaurant. The evidence showed that Richards and at least one other demonstrator physically attempted to take Escoe away from the police while an officer was attempting to handcuff Escoe.
On appeal, Richards argues that: (1) the trial court erroneously failed to give a sua sponte jury instruction on the lesser included offense of rescue; (2) the trial court erred in declining to give an instruction on mistake of fact based upon the defense theory that Richards did not know Escoe was in lawful police custody; and (3) the trial court made several erroneous and prejudicial evidentiary rulings. We agree that attempted rescue is a lesser included offense of an attempted violation of section 405a, and that the trial court committed reversible error in failing to give a sua sponte instruction on attempted rescue. We find no error with respect to the other issues that *554Richards raises. We therefore reverse the conviction and remand for retrial or, at the discretion of the prosecution, for resentencing on the lesser included offense of attempted rescue under section 4550.
FACTUAL BACKGROUND
1. Prosecution Evidence
a. Events at the restaurant
On August 29, 2015, about 4:20 p.m., Pasadena Police Officers Krikorian and Covarrubias received a call about a possible battery incident at the Las Comadres restaurant on Fair Oaks Avenue. When they arrived at the scene, two other officers were already there and had detained someone, who was later identified as Benita Escoe. Krikorian spoke to a woman named Guadelupe Rodriguez, who told Krikorian that she had received a telephone call from her mother, Augustina Rodriquez, telling her that a suspect had punched Augustina in the face and then left the store where Augustina worked. Guadelupe said that she confronted the suspect, Escoe, and that Escoe then punched and kicked her while Guadelupe hit back in self-defense. The altercation concerned a dispute at Augustina's restaurant concerning the restaurant's refusal to accept Escoe's credit card.
Krikorian spoke to Escoe, who did not want to talk other than to express a concern about getting her phone back. Krikorian and Covarrubias decided that they would place Escoe under arrest for battery. The officers informed Escoe that she was under arrest.
At that point, about 10 to 15 persons who were demonstrating across Fair Oaks Avenue at La Pintoresca Park, including Richards, approached the officers. They were chanting, "Black Lives Matter," and also yelling profanities at the officers. The demonstrators formed a half-circle around the officers, who were attempting to put Escoe in a police car. Escoe walked away into the group of demonstrators, which formed a "bubble" around her. Richards told Escoe that she did not need to tell the officers anything, and, "You stay here with me; I got you." The officers backed away from the situation to avoid a physical confrontation. Krikorian called for assistance.
*98b. Events at the park
The police had learned of the demonstration in advance and had been monitoring it with patrol units and a helicopter. Several officers responded to Krikorian's call for assistance, including Officers Garcia and Bzdigian. Bzdigian observed a small group of protesters move Escoe across the street and into the park.
*555After the officers had verified that the victims were willing to proceed with a citizen's arrest and prosecution of Escoe, Bzdigian and Garcia drove around to the other side of the park, on Raymond Avenue, where they were met by several more officers. The officers had formulated a plan to arrest Escoe at a time when she separated herself from the group. The protesters were yelling various slogans at the officers, such as "fuck the police" and "justice for Kendrec McDade."
Before driving around the park to the Raymond Avenue side, Garcia had observed Escoe walking over to a bush in the park with two or three demonstrators, where Escoe attempted to conceal herself. While the majority of the demonstrators was occupied with Bzdigian and Garcia on the Raymond Avenue side, Officers Ling and Cordova drove around to the Fair Oaks side of the park in an effort to apprehend Escoe away from most of the demonstrators. As Ling and Cordova drove into the park from the Fair Oaks side, Bzdigian and Garcia started walking from the other side of the park toward Escoe. Escoe then started walking toward the group of demonstrators. At that point, Richards said something to the crowd that Garcia interpreted as a direction to surround the officers.
The officers made a video recording of events at the park, which was introduced and played at trial. The transcript of the recording quotes Richards saying around this time: "No cop zone! No cop zone. What the fuck is ya'll doing? And this is-C'mon ya'll. Step away, 'cause they're surrounding us. Come here. C'mon. Everybody move as a unit. Listen to my voice. Let's move. Can't you see what the police is doing? And we'll move around they ass."
As the officers approached Escoe, the crowd surrounded her. Garcia walked through the demonstrators and advised the crowd that the officers were going to arrest Escoe, "and that if anybody interfered, they would be arrested for interfering with our investigation."
An unidentified man was standing next to Escoe. Garcia walked up to Escoe, grabbed her left arm, and told her that she was under arrest. Escoe tried to pull away. At that point, Richards stepped between them, and the unidentified man started pulling Escoe by her other arm. Bzdigian arrived and the officers were able to pull Escoe away from Richards and the unidentified man, and Garcia attempted to place Escoe in handcuffs.
As Garcia was attempting to apply a handcuff to Escoe's left hand, Richards "jumped in" and grabbed Escoe by her other arm, pulling Escoe away from Garcia. Garcia said, "I don't want to hurt anyone. I don't want to hurt anyone." Bzdigian used his forearm to push Richards to the ground. Ling arrived and helped Garcia place the other handcuff on Escoe.
*556After Bzdigian pushed Richards, she said, "He slammed me. He slammed me on the ground. You're 'bout to get fucked up. Black lives matter is out here. I didn't ...." After some additional exchanges, Richards told the officers, "Put your badge down, get fucked up"; "You see them slammed me. And I never touched them. All right. Fuck you, bitch! Put your badge down. Put your badge down! Put your stick down, see what happens."
*99After Bzdigian pushed Richards to the ground, another protester in the group also stated, "God gon' strike all of ya'll down to hell. Ya'll think ya'll doing good shit? God gon' strike all of ya'll down. Fuck that I ain't no fucking friendly people. Fuck cops, nigga. P-D-L. Ya'll ain't shit. Every last one of you." Bzdigian testified that the initials "PDL" referred to "Pasadena Denver Lanes," a street gang in the city of Pasadena.
Escoe ultimately pleaded no contest to one count of misdemeanor battery and one count of resisting an officer in the performance of his or her duty.
2. The Defense Case
Richards did not present any evidence in her case. During closing, Richards argued that Escoe was not in lawful custody; Escoe was not in custody at all at the time that the officers pulled her away from Richards; the demonstrators were engaged in a peaceful protest, not a riot; there was no force or violence, or immediate threat of force or violence; and there was no proof beyond a reasonable doubt that Richards had a specific intent to take Escoe from the police.
DISCUSSION
1. The Trial Court Committed Prejudicial Error in Failing to Give a Sua Sponte Instruction on a Lesser Included Offense
Richards was convicted of an attempted violation of section 405a. That section punishes anyone who "participates in the taking by means of a riot of another person from the lawful custody of a peace officer."2 Section 404, subdivision (a) defines "riot" as "[a]ny use of force or violence, *557disturbing the public peace, or any threat to use force or violence, if accompanied by immediate power of execution, by two or more persons acting together, and without authority of law."
Richards argues that the jury should have been instructed on the elements of attempted rescue under section 4550 as well as the charged offense of an attempted violation of section 405a. Section 4550 punishes anyone "who rescues or attempts to rescue, or aids another person in rescuing or attempting to rescue any prisoner from any prison, or prison road camp or any jail or county road camp, or from any officer or person having him or her in lawful custody." (§ 4550.)
During the jury instruction conference, the trial court informed the parties that it had identified no lesser included offenses, and the parties agreed that there were none. However, "California law has long provided that even absent a request, and over any party's objection, a trial court must instruct a criminal jury on any lesser offense 'necessarily included' in the charged offense, if there is substantial evidence that only the lesser crime was committed." ( People v. Birks (1998) 19 Cal.4th 108, 112, 77 Cal.Rptr.2d 848, 960 P.2d 1073 ( Birks ).) This rule ensures that "the jury may consider all supportable crimes necessarily included within the charge itself, *100thus encouraging the most accurate verdict permitted by the pleadings and the evidence." ( Ibid. ) The rule also "prevents either party, whether by design or inadvertence, from forcing an all-or-nothing choice between conviction of the stated offense on the one hand, or complete acquittal on the other." ( Id. at p. 119, 77 Cal.Rptr.2d 848, 960 P.2d 1073.)
" '[A] lesser offense is necessarily included in a greater offense if either the statutory elements of the greater offense, or the facts actually alleged in the accusatory pleading, include all the elements of the lesser offense, such that the greater cannot be committed without also committing the lesser.' " ( People v. Smith (2013) 57 Cal.4th 232, 240, 159 Cal.Rptr.3d 57, 303 P.3d 368, quoting Birks, supra , 19 Cal.4th at pp. 117-118, 77 Cal.Rptr.2d 848, 960 P.2d 1073.) A trial court's failure to give a sua sponte instruction on a lesser included offense is reviewed under the de novo standard. ( People v. Zamani (2010) 183 Cal.App.4th 854, 875, 107 Cal.Rptr.3d 608.)
We agree with Richards that the offense of attempted rescue defined in section 4550 is a lesser included offense of an attempted violation of section 405a. All of the statutory elements of attempted rescue are included within the offense of an attempted violation of section 405a. As relevant here, under section 4550 the elements of attempted rescue are: (1) an attempt (2) by one person or in connection with others (3) to rescue a prisoner (4) from the lawful custody of an officer or other person. The elements of an attempted violation of section 405a are (1) an attempt (2) to participate (3) in the taking *558of another person (4) by means of a riot (5) from the lawful custody of a police officer. ( §§ 405a, 664.)
Thus, an attempted violation of section 405a contains all the elements of attempted rescue, along with the additional element that the taking must be "by means of a riot." ( § 405a.) As the court explained in Jones , "Although both sections deal with the taking of persons from lawful custody, the anti-lynch law concerns only the taking by means of riot, which presents greater danger to the officers and populace than a single act of only a few disciplined persons." ( Jones, supra , 19 Cal.App.3d at p. 445, 96 Cal.Rptr. 795.)3
Respondent argues that attempted rescue under section 4550 is not a lesser included offense of an attempted violation of section 405a because the punishment for a violation of section 4550 is greater than the punishment for an attempted violation of section 405a. Respondent cites no authority for the proposition that the severity of possible punishment can be a determining factor in whether a particular crime is a lesser included offense of another crime. The severity of punishment is not an element of either the "elements" test or the "accusatory pleading" test that our Supreme Court has identified as the proper methodologies for identifying lesser included offenses. (See People v. Shockley (2013) 58 Cal.4th 400, 404, 165 Cal.Rptr.3d 497, 314 P.3d 798.) However, we need not decide this legal issue, as the predicate for respondent's argument is missing here. A violation of section 4550 in fact may result *101in less punishment than an attempted violation of section 405a.
Respondent compares only the sentencing range for an attempted violation of section 405a4 with the sentence for a violation of section 4550 when the latter violation is punished as a felony . But a violation of section 4550 is a "wobbler" offense that may be punished either as a felony or a misdemeanor.5
*559Even if severity of punishment were a relevant factor in identifying a lesser included offense, respondent cannot credibly claim that the punishment for a violation of section 4550 is more severe than the punishment for an attempted violation of section 405a when the former can be a misdemeanor and the latter is always a felony.
Because attempted rescue is a lesser included offense of an attempted violation of section 405a, the trial court was required to instruct on attempted rescue if the evidence raised " 'a question as to whether all of the elements of the charged offense were present,' and there was evidence that 'the offense was less than that charged.' " ( People v. Breverman (1998) 19 Cal.4th 142, 154, 77 Cal.Rptr.2d 870, 960 P.2d 1094 ( Breverman ).) To warrant instruction, the evidence that a defendant is guilty of only the lesser offense must merely be " 'substantial enough to merit consideration' by the jury." ( Id. at p. 162, 77 Cal.Rptr.2d 870, 960 P.2d 1094, quoting People v. Flannel (1979) 25 Cal.3d 668, 684, fn. 12, 160 Cal.Rptr. 84, 603 P.2d 1.)
To prove that Richards was guilty of an attempted violation of section 405a and not just a violation of section 4550, the prosecution had to prove that Richards had the specific intent to participate in an attempt to take Escoe from the custody of the police "by means of a riot." ( §§ 21a, 405a.) A riot requires the actual or threatened use of force or violence "by two or more persons acting together , and without authority of law." (§ 404, subd. (a), italics added.) Thus, to show an attempted violation of section 405a, the prosecution needed to prove that Richards intended to participate in taking Escoe from the police through the use of force or threats "by two or more persons acting together." (Ibid. )6
The evidence at trial established that Richards and at least one other person actually used force in resisting the police efforts to take Escoe. An unidentified man *102pulled on Escoe while the officers were trying to take her away. Richards then grabbed and pulled on Escoe at the same time that Officer Garcia had Escoe's arm and was trying to handcuff her. Richards is clearly visible on the video pulling on Escoe at the same time the officers were trying to pull Escoe away.
However, the jury could have reasonably concluded that Richards did not form the intent to use force or violence (or the threat of force or violence)
*560together with another person. (§ 404, subd. (a).) As the video confirms, the relevant events transpired very quickly. Only four or five seconds elapse on the recording between the time that Richards grabs Escoe and the time that Bzdigian pushes Richards to the ground. During that time Richards is not clearly using force together with anyone else. When Richards appears on the video pulling on Escoe, she does so herself. Thus, the jury could have reasonably found either that Richards did not act together with another person in using force, or, if she did, the events happened so quickly that Richards did not do so intentionally. Based upon that conclusion, the jury could have found that Richards failed to form the intent to take Escoe from the police "by means of a riot." ( § 405a.)7
In light of this evidence, the trial court's error in failing to instruct on the lesser included offense of attempted rescue was prejudicial. "[T]he failure to instruct sua sponte on a lesser included offense in a noncapital case is, at most, an error of California law alone, and is thus subject only to state standards of reversibility." ( Breverman, supra, 19 Cal.4th at p. 165, 77 Cal.Rptr.2d 870, 960 P.2d 1094.) Under those standards, reversal is required when "an examination of the entire record establishes a reasonable probability that the error affected the outcome." ( Ibid. ; Cal. Const., art. VI, § 13 ; People v. Watson (1956) 46 Cal.2d 818, 836, 299 P.2d 243.)
The video recording was the most significant piece of evidence at trial. The prosecutor used it extensively in examining witnesses and in closing argument. The defense also relied on it heavily, urging the jury to "play that video again and again," because "there is no riot."
The recording shows a demonstration that, while insulting and profane toward the officers, was peaceful with the exception of the brief scuffle over Escoe. Richards's efforts to pull Escoe away from the police lasted only seconds. If the jury had been given another alternative to convict Richards for her interference with the police, the jury could easily have concluded that Richards's resort to the minimal force apparent on the video was impulsive and did not involve the intentional participation with others in the actual or threatened use of force or violence that was necessary for a riot. Under this evidence, there was a reasonable probability that the absence of an instruction on attempted rescue affected the outcome.
We therefore must reverse the judgment. When a greater offense must be reversed, but a lesser included offense could be affirmed, "we give the *561prosecutor the option of retrying the greater offense, or accepting a reduction to the lesser offense." ( People v. Kelly (1992) 1 Cal.4th 495, 528, 3 Cal.Rptr.2d 677, 822 P.2d 385.) As discussed further below, we reject Richards's other claims of error. Thus, although *103Richards's conviction for attempted violation of section 405a must be reversed, a conviction for attempted rescue under section 4550 could be affirmed. We will therefore give the prosecution the option of either retrying Richards on the charged felony count of an attempted violation of section 405a or permitting resentencing under section 4550.
2. The Trial Court Did Not Err in Declining Richards's Request for an Instruction on Mistake of Fact
At trial, Richards requested a jury instruction on mistake of fact ( CALCRIM No. 3406 ), arguing that she could not be convicted of an attempted violation of section 405a if she believed that Escoe was not in the "lawful custody" of the police. The trial court rejected the instruction. The court ruled that, while the prosecution must prove Escoe was in fact in lawful custody, it need not prove that Richards knew the custody was lawful. The court reasoned that, if the law were otherwise, "any time before the police ever want to take anybody in custody, there would be potential objectors in the public who can come and approach the police and say, no, you can't take her into custody." The court concluded that this would "not be a workable system."
For the reasons discussed below, the trial court did not err in rejecting the proposed instruction. The trial court correctly concluded that an attempted violation of section 405a does not require knowledge that the person a defendant attempted to take from the police was in lawful custody.
a. Knowledge of the lawfulness of police conduct is not a necessary element of an attempted violation of section 405a
Whether the trial court should have given a mistake of fact instruction depends in part upon the state of mind necessary for conviction of an attempted violation of section 405a. That is a legal question, and we therefore review it under the de novo standard. (See People v. Braslaw (2015) 233 Cal.App.4th 1239, 1244, 183 Cal.Rptr.3d 575.)
Richards claims that the trial court erred in refusing the requested instruction because a belief that Escoe was not in the lawful custody of the police negates the intent element of an attempted violation of section 405a. Richards argues that, to be guilty of such an attempt, a defendant must intend to take another person from lawful police custody. For a number of reasons *562we conclude that the intent element of an attempted violation of section 405a should not be defined to include knowledge of the lawfulness of police conduct.
First, neither the language of the statute nor the principle underlying the punishment of attempts justifies such a standard. Section 405a does not define any specific intent element for the completed crime. Anyone who "participates" in the proscribed activity falls within the scope of the statute. (See People v. Patino (1979) 95 Cal.App.3d 11, 27, 156 Cal.Rptr. 815 ["It is clear that the offense of lynching [citation] is a general intent crime, rather than a specific intent crime"].) "Lawful custody" is an element of the completed crime, but the statute does not require knowledge of the lawfulness of police custody as a separate element.
Richards does not argue that section 405a requires any specific intent, but rather relies on the rule that, to be guilty of an unlawful attempt, a defendant must have the specific intent to commit the underlying offense. (See § 21a.) That rule is based on the principle that " ' "[o]ne of the purposes *104of the criminal law is to protect society from those who intend to injure it. When it is established that the defendant intended to commit a specific crime and that in carrying out this intention he committed an act that caused harm or sufficient danger of harm, it is immaterial that for some collateral reason he could not complete the intended crime." ' " ( People v. Medina (2007) 41 Cal.4th 685, 694, 61 Cal.Rptr.3d 677, 161 P.3d 187 ( Medina ), quoting People v. Toledo (2001) 26 Cal.4th 221, 229-230, 109 Cal.Rptr.2d 315, 26 P.3d 1051.)
The crux of the offense that section 405a establishes-and the essence of the harm to society punished by that offense-is taking a person from the custody of a peace officer by means of a riot. While the person must be in lawful custody to establish the completed offense, the threat to social order exists whether or not a person attempting that offense actually knows that the person he or she takes is held lawfully.
Second, reading such a knowledge requirement into the offense of attempted violation of section 405a would be inconsistent with the law on mistake as a defense. There are circumstances in which a good faith mistake about the legal significance of the relevant facts may negate a defendant's specific intent and constitute a defense to a crime. For example, a mistaken belief about the ownership status of property can be a defense to the receipt of stolen property ( People v. Russell (2006) 144 Cal.App.4th 1415, 1431, 51 Cal.Rptr.3d 263 ); a good faith mistake about the defendant's legal right to take or use property can be a defense to theft or embezzlement ( People v. Vineberg (1981) 125 Cal.App.3d 127, 137, 177 Cal.Rptr. 819 ;
*563People v. Stewart (1976) 16 Cal.3d 133, 139, 127 Cal.Rptr. 117, 544 P.2d 1317 ); and a mistake about the validity of a child custody order might constitute a defense to a crime of violating that order ( People v. Flora (1991) 228 Cal.App.3d 662, 669-670, 279 Cal.Rptr. 17 ). However, in such cases the mistaken belief "must relate to a set of circumstances which, if existent or true, would make the act charged an innocent act ." ( People v. Lawson (2013) 215 Cal.App.4th 108, 115, 155 Cal.Rptr.3d 236, italics added.) Such a belief precludes the finding of wrongful intent that is generally required to establish the mens rea for a criminal offense. (See id. at p. 114, 155 Cal.Rptr.3d 236 ; § 26 [the classes of persons who are incapable of committing crimes include those "who committed the act ... charged under an ignorance or mistake of fact, which disproves any criminal intent"].)
Thus, when a mistake concerns only the severity of an offense, and the defendant's conduct remains unlawful even under the defendant's mistaken view of the facts, courts have not recognized mistake as a defense. For example, in People v. Branch (2010) 184 Cal.App.4th 516, 109 Cal.Rptr.3d 412 ( Branch ), the court held that the defendant was not entitled to an instruction that the defendant's good faith, reasonable belief the victim was 18 years old was a defense to the charges of attempted pimping and pandering of a minor under the age of 16. ( Id. at pp. 520-522, 109 Cal.Rptr.3d 412.) The court distinguished that case from cases that recognized the defense of mistake concerning the age of the victim in prosecutions for sexual intercourse with a minor and contributing to the delinquency of a minor. ( Id. at pp. 521-522, 109 Cal.Rptr.3d 412, citing People v. Hernandez (1964) 61 Cal.2d 529, 39 Cal.Rptr. 361, 393 P.2d 673 ; People v. Atchison (1978) 22 Cal.3d 181, 148 Cal.Rptr. 881, 583 P.2d 735.) The court observed that, unlike those cases, the defendant's conduct in Branch (attempted pimping and pandering) would be criminal regardless of the victim's age.
*105The court in Branch analogized the attempted pandering in that case to the conduct of selling cocaine to a minor at issue in People v. Williams (1991) 233 Cal.App.3d 407, 284 Cal.Rptr. 454. The court in Williams reasoned that "[t]he specific intent for the crime of selling cocaine to a minor is the intent to sell cocaine, not the intent to sell it to a minor. [Citations.] It follows that ignorance as to the age of the offeree neither disproves criminal intent nor negates an evil design on the part of the offeror. It therefore does not give rise to a 'mistake of fact' defense to the intent element of the crime." ( Id. at p. 411, 284 Cal.Rptr. 454.)
Similarly, here, attempting to take someone from the police by means of a riot is criminal even if the defendant believes that the police custody is unlawful. At a minimum, such conduct involves participation, or attempted participation, in a riot, and may also be an unlawful disturbance of the peace.
*564(See §§ 405, 415.) In addition, the "use of force or violence" against the police, or a "threat to use force or violence" that is "accompanied by immediate power of execution" (§ 404, subd. (a)), will likely also amount to a criminal assault or battery. (§§ 240, 242.)8 The unlawfulness of an arrest is not a defense to assault or battery used to resist arrest. (See § 834a ["If a person has knowledge, or by the exercise of reasonable care, should have knowledge, that he is being arrested by a peace officer, it is the duty of such person to refrain from using force or any weapon to resist such arrest"]; People v. Curtis (1969) 70 Cal.2d 347, 351-353, 74 Cal.Rptr. 713, 450 P.2d 33 ( Curtis ).)9
Third, recognizing a mistaken belief about the lawfulness of police custody as a defense to an attempted violation of section 405a would violate public policy. The defense of mistake of fact is not appropriate where its recognition would excuse behavior that violates a strong public policy. (See Branch, supra, 184 Cal.App.4th at p. 522, 109 Cal.Rptr.3d 412 ; People v. Olsen (1984) 36 Cal.3d 638, 646, 205 Cal.Rptr. 492, 685 P.2d 52 ( Olsen ) [declining to recognize the defense of reasonable mistake about the victim's age in a prosecution for lewd or lascivious conduct with a minor under the age of 14 because doing so would contradict the "strong public policy to protect children of tender years"].)
There is a public policy against the use of force as a self-help remedy for police misconduct. That public policy underlies *106the requirement in section 834a that a person may not use force to resist an unlawful arrest. As our Supreme Court observed in Curtis : "In a day when police are armed with lethal and chemical weapons, and possess scientific communication and detection devices readily available for use, it has become highly unlikely that a suspect, using reasonable force, can escape from or effectively deter an arrest, whether lawful or unlawful. His accomplishment is generally limited *565to temporary evasion, merely rendering the officer's task more difficult or prolonged. Thus self-help as a practical remedy is anachronistic, whatever may have been its original justification or efficacy in an era when the common law doctrine permitting resistance evolved." ( Curtis, supra, 70 Cal.2d at p. 353, 74 Cal.Rptr. 713, 450 P.2d 33 ; see Evans v. City of Bakersfield (1994) 22 Cal.App.4th 321, 332, 27 Cal.Rptr.2d 406 ( Evans ) [concluding that the reasoning in Curtis precludes the use of force to resist an unlawful detention as well as an unlawful arrest].)
Richards concedes that "there may be public policy reasons against allowing a mistake of fact defense with respect to the completed crime of section 405a," but argues that "these considerations do not apply to the charge of attempt. " We do not agree. As discussed above, the law punishes criminal attempts because of the danger that the attempted conduct poses to society. ( Medina, supra, 41 Cal.4th at p. 694, 61 Cal.Rptr.3d 677, 161 P.3d 187.) An attempt to take someone from the police by means of a riot poses a danger to police and others even if the perpetrator believes that the police have acted unlawfully, and even if the attempt is unsuccessful. Indeed, as our Supreme Court observed in Curtis, in light of the modern tools available to the police the use of force to resist or escape custody is more likely to result in an unsuccessful attempt than in successful resistance. ( Curtis , supra , 70 Cal.2d at p. 353, 74 Cal.Rptr. 713, 450 P.2d 33.)10
Fourth, a standard that makes proof of intent dependent upon a defendant's subjective belief concerning the lawfulness of police conduct is impractical. As Richards recognizes, if the lawfulness of police custody is an element of the intent required for an attempted violation of section 405a, any honest belief in the unlawfulness of the custody, no matter how unreasonable, would constitute a defense. ( People v. Watkins (1992) 2 Cal.App.4th 589, 594, 3 Cal.Rptr.2d 563.) But persons charged with an attempted violation of section 405a will not necessarily know all the factual circumstances surrounding an *566arrest, much less understand the legal significance of those *107circumstances.11 A subjective standard in these circumstances makes conviction dependent on the defendant's imperfect knowledge of events as filtered through the defendant's personal life experience and world view. The observations of the court in Evans are equally apt here: "[W]e are swayed by the commonsense realization that the propriety of a detention is often the subject of a vigorously contested 'motion to suppress' presented in court long after the initial incident. If the ultimate determination of the lawfulness of the detention is a troublesome question for trained legal minds, should there be a rule of law allowing spur-of-the moment physical force triggered by the detainee's lay perception of the detention's legal justification? The mere positing of the question provides the answer. No." ( Evans , supra , 22 Cal.App.4th at pp. 332-333, 27 Cal.Rptr.2d 406.)
Richards relies on the statement in Maria D. that "in order to be guilty of attempted lynching, a defendant must harbor a specific intent to free a lawfully detained person." ( Maria D., supra, 199 Cal.App.4th at p. 116, 131 Cal.Rptr.3d 21.) That case did not concern the precise knowledge element required for attempted lynching, but rather considered and rejected the appellant's argument that the offense of attempted lynching should not be recognized because it is already included within the less serious offense of inciting a riot under section 404.6, subdivision (a). ( Id. at pp. 115-116, 131 Cal.Rptr.3d 21.) The court distinguished the intent necessary for attempted lynching from the intent necessary under section 404.6, which "requires proof that a defendant have the specific intent to do nothing more than cause a riot." ( Id. at p. 116, 131 Cal.Rptr.3d 21.) The important distinction in that case was between an intent simply to cause a riot and an intent to participate in a riot to free someone from the police. The case did not hold that actual knowledge of lawful police custody is necessary for conviction of an attempted lynching, and we do not find it persuasive on that point here.
We therefore conclude that the trial court did not err in refusing an instruction that Richards's belief in the unlawfulness of Escoe's custody constituted a defense.
*567b. Knowledge that a person is in the legal "custody" of the police is not an element of an attempted violation of section 405a
Richards also argues that the trial court erred in refusing an instruction that Richards was not guilty if she mistakenly believed that Escoe was not in police custody at all. We conclude that such an instruction was not warranted under the facts of this case.
For the same reasons discussed above, knowledge that a person is in police "custody" as defined by the law is not necessary to prove an attempted violation of section 405a. All that is necessary is an intent to participate in taking a person from the police by means of a riot. Such conduct is unlawful and poses the same *108dangers to police and others, even if a defendant believes that the police do not actually have the person in "custody" in a legal sense. A rule requiring knowledge of the legal status of custody would raise the same policy and practical problems as a rule requiring knowledge that the police acted lawfully in taking the person into custody.
The evidence in this case leaves no doubt that Richards knowingly attempted to take Escoe away from the police. Richards clearly knew that the officers were police; indeed, that was the basis for her announcement that the park was a "[n]o cop zone" and her admonishment that "[t]he police are trying to come in the park." The officers also announced that "[i]f anyone assists [Escoe], they're going to get arrested." The evidence also showed that Richards tried to take Escoe from the officers. Garcia testified that Richards tried to pull Escoe away from him after Garcia had grabbed Escoe's arm and had told her she was under arrest.12 Richards's attempt is clearly visible in the video recording.
While Richards disputes whether she intended to incite or participate in a riot, she acknowledges that she "and two other individuals were physically involved in attempting to extract Escoe." Whether Richards knew that this attempted extraction occurred while Escoe was in formal police custody was irrelevant to the element of intent under section 405a. It was sufficient that Richards intended to take Escoe from the police.13
*568A trial court is not required to give an instruction on mistake that is not supported by substantial evidence. ( People v. Meneses (2008) 165 Cal.App.4th 1648, 1665-1666, 82 Cal.Rptr.3d 100.) We therefore find no error in the trial court's refusal to give a mistake instruction here.
3. The Trial Court Did Not Err in its Evidentiary Rulings
Richards claims that the trial court committed reversible error with respect to two evidentiary rulings. First, she argues that the trial court should not have permitted testimony explaining that the protester's statement about "PDL" referred to a gang affiliation. Second, she claims that the trial court should have excluded evidence concerning Escoe's no contest pleas. We conclude that the trial court acted within its discretion with respect to each of these decisions. ( People v. Albarran (2007) 149 Cal.App.4th 214, 225, 57 Cal.Rptr.3d 92 [trial court's evidentiary rulings are reviewed for abuse of discretion].)
First, the protester's statement referring to the PDL gang was directly *109relevant to an element of the charged offense. A defendant may be convicted under section 405a if he or she "participates" in taking another person from the lawful custody of the police "by means of a riot." ( § 405a.) As discussed above, a riot may be established by proof of actual force or violence or by "any threat to use force or violence, if accompanied by immediate power of execution." (§ 404, subd. (a).) Part of Richards's defense at trial was that she did not participate in a riot. Evidence that one of the protesters announced a gang affiliation in a threatening manner was relevant to the existence of a threat to the officers that might constitute a riot under section 404, subdivision (a).
Richards argues that the protestor's statement was irrelevant because it was made after Escoe had already been led away and the "alleged attempted taking had ended." But Richards was charged with an attempt, which requires specific intent, and her state of mind was therefore an important issue. Evidence that another participant in the demonstration made threatening, gang-related statements was relevant to the nature of the demonstration, and *569therefore to Richards's state of mind in participating in the demonstration, regardless of when those statements were made.
Nor did the trial court err in deciding that the testimony about gang affiliation was not unduly prejudicial. The testimony did not attempt to link Richards to a gang or suggest that the jury make such an inference. It simply explained the significance of the reference to "PDL" and why the officers could believe it was threatening.
Second, the trial court acted within its discretion in concluding that evidence of Escoe's conviction was relevant to rebut one of Richards's defenses. Richards claimed at trial that Escoe was not in lawful police custody because there were no legal grounds for her arrest. Moreover, the jury was instructed that it must find that the officers "were lawfully performing their duties as a peace officer," and that "[a] peace officer is not lawfully performing his or her duties if he or she is unlawfully arresting or detaining someone." In light of Richards's defense and the prosecution's burden as described in the instructions, the trial court reasonably concluded that Escoe's plea was relevant to rebut any "mistaken impression that, in fact, the suspect [ (Escoe) ] could have been an innocent victim." The conclusion was logically based on the fact that the evidence "goes to the lawfulness of the custody."
Like the protester's statement referring to a gang, evidence concerning Escoe's plea was also not unfairly prejudicial. The plea concerned a third party, not Richards. It did not implicate Richards in any unrelated criminal conduct. There was no testimony concerning any of the underlying facts leading to Escoe's conviction.
We therefore conclude that the trial court properly acted within its discretion in admitting both of these items of evidence.
DISPOSITION
The judgment is reversed and the case is remanded for further proceedings pursuant to the procedure outlined in People v. Hayes (2006) 142 Cal.App.4th 175, 184, 47 Cal.Rptr.3d 695, and People v. Brown (2016) 245 Cal.App.4th 140, 173, 199 Cal.Rptr.3d 303. If, after the filing of the remittitur in the trial court, the prosecution does not bring Richards to retrial on the charged offense of an attempted violation of section 405a within the time limit of Penal Code section 1382, subdivision (a)(2), the trial court shall proceed as if the remittitur constituted a modification of the *110judgment to reflect *570a conviction of the lesser included offense of attempted rescue in violation of Penal Code section 4550, and shall resentence Richards accordingly.
We concur:
CHANEY, Acting P. J.
JOHNSON, J.
Subsequent undesignated statutory references are to the Penal Code.
Before it was amended in 2015, section 405a labeled the offense that it defines as "lynching." (See Stats. 2015, ch. 47, § 1; People v. Jones (1971) 19 Cal.App.3d 437, 442-443, 96 Cal.Rptr. 795 (Jones ).) That term as applied to section 405a differs from the popular sense of a "lynching." Under section 405a, there is no requirement that a person be taken from the police with the intention to impose an extra-legal summary punishment. (Jones , at p. 443, 96 Cal.Rptr. 795.) The term "lynching" appears in the cases interpreting section 405a, and the parties therefore occasionally use the term as well. We similarly sometimes use the term, without any intention to import its historical or popular meaning.
Although section 4550 uses the term "prisoner" rather than "person," that section does not include any definition of a "prisoner" other than someone who is in the custody of law enforcement. (See Jones, supra, 19 Cal.App.3d at pp. 441-442, 96 Cal.Rptr. 795 [defendant was guilty of lynching based upon his participation in taking a person who had just been arrested from the backseat of a police vehicle].) This element is included in the requirement in both section 4550 and section 405a that the offender take another person who is in "lawful custody."
Violation of section 405a is a felony "punishable by imprisonment pursuant to subdivision (h) of Section 1170 for two, three or four years." (§ 405a.) Under section 664, conviction for an attempted violation of section 405a is punishable by imprisonment "for one-half the term of imprisonment prescribed upon a conviction of the offense attempted," i.e., for 12, 18, or 24 months. (§ 664, subd. (a) ; In re Maria D. (2011) 199 Cal.App.4th 109, 114, 131 Cal.Rptr.3d 21 (Maria D. ).)
Section 4550, subdivision (b) applies to the unlawful rescue of any prisoner other than one who was "in custody upon a conviction of a felony punishable with death." (§ 4550, subd. (a).) Violation of section 4550, subdivision (b) may be punished by "imprisonment pursuant to subdivision (h) of Section 1170, or by imprisonment in the county jail not to exceed one year." If sentenced under the former provision, the violation is a felony, which under section 1170, subdivision (h) would be punished by imprisonment for sixteen months, or two or three years. (§ 1170, subd. (h)(1).) If a violation of section 4550 is sentenced under the latter provision, or if the sentencing court declares the violation to be a misdemeanor when granting probation without imposing sentence, a violation of section 4550, subdivision (b) is a misdemeanor. (§ 17, subd. (b)(1), (3).)
The jury was instructed that a riot "occurs when two or more people, acting together and without legal authority, disturb the public peace by using force or violence or by threatening to use force or violence with the immediate ability to carry out those threats."
Events that occurred on the Fair Oaks side of the park when officers Krikorian and Covarrubias initially attempted to arrest Escoe were not recorded on video. However, the evidence did not establish any use of force at that time. Rather, the demonstrators formed a "bubble" around Escoe and moved her away from the officers.
Battery can occur even when contact is indirect, such as grabbing an object out of a victim's hand. (See In re B.L. (2015) 239 Cal.App.4th 1491, 1496, 192 Cal.Rptr.3d 154 [finding battery where a student knocked a walkie-talkie out of the hand of a physical education teacher].) Here, there was evidence that Richards attempted to pull Escoe away from the officer who was holding her.
In Curtis, our Supreme Court affirmed a line of cases holding that section 834a applies to unlawful as well as lawful arrests, explaining that the section eliminates "the common law defense of resistance to unlawful arrest." (Curtis, supra, 70 Cal.2d at p. 354, 74 Cal.Rptr. 713, 450 P.2d 33 ; id. at pp. 351-352, 74 Cal.Rptr. 713, 450 P.2d 33.) Although the unlawfulness of police conduct may be a defense to violations that specifically punish interference with police in the performance of their lawful "duty" (such as violations of sections 69 and 148), it is not a defense to simple assault or battery in resisting arrest. (Curtis, at pp. 355-356, 74 Cal.Rptr. 713, 450 P.2d 33 ; In re Manuel G. (1997) 16 Cal.4th 805, 815-816, 66 Cal.Rptr.2d 701, 941 P.2d 880.) If the person being arrested has no right to resist the arrest with force, a third party has no right to defend that person with force. (Cf. People v. Craig (1907) 152 Cal. 42, 50, 91 P. 997 [under the common law and § 694, a third party cannot interfere with an arrest "except in aid of a lawful resistance by the person threatened"].)
Richards cites People v. Hanna (2013) 218 Cal.App.4th 455, 160 Cal.Rptr.3d 210 for the proposition that policy considerations that preclude a mistake of fact defense to a completed crime do not apply to an attempted commission of that crime. The court in Hanna distinguished our Supreme Court's decision in Olsen, supra , 36 Cal.3d 638, 205 Cal.Rptr. 492, 685 P.2d 52, that public policy precludes a mistake of fact defense to commission of a lewd act on a child under the age of 14 on the ground that the defendant in Olsen was convicted of the completed offense and the defendant in Hanna was charged with an attempt. (Hanna, at p. 461, 160 Cal.Rptr.3d 210.) The court did not explain why it concluded that the policy considerations were different for an attempted and a completed act of lewd conduct with a minor under age 14, and we need not consider that issue here. The court apparently based its decision on the fact that the purported belief of the defendant in that case that the minor in question was over 18 would have made the defendant's conduct lawful . (See id. at pp. 461-462, 160 Cal.Rptr.3d 210.) As discussed above, that principle does not apply here. We do not read Hanna as holding that policy reasons can never preclude a mistake of fact defense for an attempted crime, nor do we interpret Olsen as suggesting such a broad rule.
That is the case here. Most of Richards's argument at trial concerning the legality of Escoe's detention addressed events that occurred in connection with Escoe's previous altercation at the restaurant. Richards was not present for that incident and had no firsthand knowledge of what occurred. Richards apparently had some information from Escoe, as reflected in Richards's statement recorded on the video that "[t]he girl that you guys are harassing had her phone stolen but you was treating her as if she was the one that did it. Why is the black person always ... why can't we be the victim?" However, there is nothing in the record indicating that Richards had any knowledge of the events at the restaurant from any other source.
In light of this evidence, we need not consider whether a mistake of fact instruction might be appropriate in other circumstances that create a reasonable doubt as to whether a defendant actually knew that he or she was attempting to take a person from the police (for example, if there is a question the persons involved were actually police officers).
The instructions that the trial court gave adequately informed the jury that it must find that Richards intended to take Escoe from the police. The court instructed the jury that it must find "[t]he defendant intended to unlawfully take a person from the lawful custody of a peace officer by means of a riot." The instructions further defined the elements of section 405a by including the requirement that "[t]he defendant intended to take the other person from the lawful custody of a peace officer when the defendant willfully participated in the riot." While these instructions were arguably ambiguous as to whether Richards must have actually known that Escoe was in "lawful custody," that ambiguity is irrelevant because, as discussed above, such knowledge was not necessary for conviction. The instructions did clearly inform the jury that it must find an intent to take a person from the police by means of a riot.