concurring in part and dissenting in part:
I agree with the majority that Raynard Cummings’s equal protection and ineffective assistance of counsel claims should be denied. I respectfully dissent, however, from the conclusion that Cummings’s due process claim must also be denied. The Supreme Court made clear in Turner v. Louisiana, 379 U.S. 466, 85 S.Ct. 546, 13 L.Ed.2d 424 (1965), and Gonzales v. Beto, 405 U.S. 1052, 92 S.Ct. 1503, 31 L.Ed.2d 787 (1972) (per curiam), that a criminal defendant’s right to a fair trial is infringed when the government solicits key testimony from a bailiff who associated closely with the jury during the defendant’s trial. Because that is precisely what occurred during Cummings’s trial, the California Supreme Court’s decision to affirm his conviction, People v. Cummings, 4 Cal.4th 1233, 18 Cal.Rptr.2d 796, 850 P.2d 1 (1993), cannot reasonably be squared with Turner and Beto. I would therefore grant Cummings’s habeas petition.
I
Bailiffs play an important role during criminal trials by maintaining order inside the courtroom and ensuring the safety of jurors and court officers. But when they step beyond that traditional role by testifying against the accused, their competing interests may deprive the defendant of due process.
Justice Stewart highlighted this danger in Beto, focusing on “the great prejudice inherent in the dual role of jury bailiff and key prosecution witness.” 405 U.S. at 1055, 92 S.Ct. 1503 (Stewart, J., concurring). He explained:
Our adversary system of criminal justice demands that the respective roles of *1151prosecution and defense and the neutral role of the court be kept separate and distinct in a criminal trial. When a key witness against a defendant doubles as the officer of the court specifically charged with the care and protection of the jurors, associating with them on both a personal and an official basis while simultaneously testifying for the prosecution, the adversary system of justice is perverted.
Id. at 1055-56, 92 S.Ct. 1503; see also Parker v. Gladden, 385 U.S. 363, 365, 87 S.Ct. 468, 17 L.Ed.2d 420 (1966) (noting that “the official character of the bailiff— as an officer of the court as well as the State — beyond question carries great weight with a jury”); Mattox v. United States, 146 U.S. 140, 149-50, 13 S.Ct. 50, 36 L.Ed. 917 (1892) (“It is vital in capital cases that the jury should pass upon the case free from external causes tending to disturb the exercise of deliberate and unbiased judgment.... Private communications, possibly prejudicial, between jurors and third persons, or witnesses, or the officer in charge, are absolutely forbidden .... ” (emphasis added)).
Recognizing that this risk of “great prejudice” arises whenever a bailiff testifies for the prosecution, the Supreme Court in Turner and Beto held that the admission of such testimony may sometimes violate a criminal defendant’s due process rights. The Court’s due process inquiry in those cases focused on two factors: (1) the importance of the bailiffs testimony and (2) the nature of the bailiffs relationship with the jury.
In analyzing the first factor, the Court examined the extent to which the jury’s verdict in each case turned on the credibility of the bailiffs’ testimony. See Turner, 379 U.S. at 473, 85 S.Ct. 546 (concluding that “the credibility which the jury attached to the testimony of these two key witnesses must inevitably have determined whether Wayne Turner was to be sent to his death”); Beto, 405 U.S. at 1053, 92 S.Ct. 1503 (Stewart, J., concurring) (referring to the case as one “that turned so largely on [the jurors’] assessment of the sheriffs credibility”). For guidance, it looked at whether the bailiffs had served as “key witnesses” or confined their testimony “to some uncontroverted or merely formal aspect of the case for the prosecution.” Turner, 379 U.S. at 473, 85 S.Ct. 546; see also Beto, 405 U.S. at 1054, 92 S.Ct. 1503 (Stewart, J., concurring) (quoting the same language from Turner). Because the bailiffs in Turner and Beto had testified to crucial inculpatory facts, including the defendants’ alleged confessions, the Court held that they fell on the “key witness” end of this spectrum. See 379 U.S. at 467, 85 S.Ct. 546 (referring to the bailiffs as “[t]he two principal witnesses for the prosecution”); 405 U.S. at 1052, 92 S.Ct. 1503 (Stewart, J., concurring) (referring to the bailiff as “the key prosecution witness”).
Deputy La Casella’s testimony regarding Cummings’s alleged confession was similarly crucial to the prosecution during the trial in this case. As the majority notes, La Casella was the only witness— other than a jailhouse informant who later recanted his testimony — to corroborate the coroner’s specific theory that Cummings fired the first shot and Gay fired the final five. See Op. 1141-42. Because multiple forensic experts and at least one eyewitness disputed the coroner’s theory of events, La Casella’s testimony proved cen*1152tral to the prosecution’s ease.1 Indeed, the prosecution itself referred to La Casella during its closing argument as “perhaps the most important witness in this case,” calling his testimony “obviously very important.” It told the jury: “His testimony alone should lead you to the conclusion to convict” Cummings.
Given the primacy that the state itself attributed to La Casella’s testimony, I agree with the majority that “[ejven under AEDPA’s deferential standard of review, it is hard to credit the [state] court’s application of Turner’s first prong.” Op. at 1141. I would therefore hold that the California Supreme Court’s conclusion that La Casel-la was not a key witness constituted an unreasonable application of clearly established federal law as determined by Turner and Beto. See 28 U.S.C. § 2254(d)(1). Unlike the majority, however, I would hold that the state court’s application of Turner ’s second prong — regarding the nature of the bailiffs relationship with the jury— also conflicts with these controlling precedents.
In Turner, the Supreme Court addressed this prong by noting that a “continuous and intimate association” between a testifying bailiff and the jury would give rise to a due process violation while a “brief encounter” would not. 379 U.S. at 473, 85 S.Ct. 546. In drawing this distinction, “Turner recognized that there is a continuum of potential prejudice resulting from different types of contacts” and that the defendant’s due process claim depends on the extent of those contacts. Beto, 405 U.S. at 1058, 92 S.Ct. 1503 (Rehnquist, J„ dissenting); see also id. at 1054-55, 92 S.Ct. 1503 (Stewart, J., concurring) (“[Turner] indicated that a mere ‘brief encounter,’ by chance, with the jury would not generally contravene due process principles.”). To illustrate the prejudicial nature of the bailiffs’ contacts with the jury in Turner, the Court explained that it “would have undermined the basic guarantees of trial by jury to permit this kind of an association between the jurors and two key prosecution witnesses who were not deputy sheriffs.” 379 U.S. at 474, 85 S.Ct. 546. The fact that the’ two witnesses had served as bailiffs simply “made the association even more prejudicial.” Id.
Turner’s contacts inquiry is distinct from the general weighing of probative value and prejudice that California courts typically use to determine the admissibility of evidence. See Cal. Evid.Code § 352 (“The court in its discretion may exclude evidence if its probative value is substantially outweighed by the probability that its admission will ... create substantial danger of undue prejudice, of confusing the issues, or of misleading the jury.”). Unlike that balancing test, Turner’s focus is constitutional, not evidentiary, and centers on the potential prejudice resulting from the bailiffs relationship with the jury — without regard to the probative value of the bailiffs testimony.2
Nevertheless, the California Supreme Court resolved the Turner question in this *1153case by applying the balancing test. Rather than examining where La Casella’s contacts with the jury fell on the spectrum between “brief encounter” and “continuous and intimate association,” the California Supreme Court simply reaffirmed the trial court’s ruling that La Casella’s “association with the jurors was so minimal and so professional that the probative value of his testimony outweighed any prejudice to Cummings from his status.” Cummings, 4 Cal.4th at 1290, 18 Cal.Rptr.2d 796, 850 P.2d 1 (emphasis added). The court included its Turner analysis under the heading, “Evidentiary Rulings,” id. at 1288, 18 Cal.Rptr.2d 796, 850 P.2d 1, and concluded the analysis by stating that the trial court “did not err in admitting [La Casella’s] testimony,” id. at 1290, 18 Cal.Rptr.2d 796, 850 P.2d 1 (emphasis added). In short, despite the California Supreme Court’s passing references to due process, the language and organization of its opinion make clear that it never applied Turner’s, second prong and, instead, relied on a state evidentiary rule to deny Cummings’s due process claim.3
“[W]hen a state court employs the wrong legal standard, the AEDPA rule of deference does not apply.” Cooperwood v. Cambra, 245 F.3d 1042, 1046 (9th Cir.2001). As this court explained in Frantz v. Hazey, a state court’s “use of the wrong legal rule or framework ... constitute^] error under the ‘contrary to’ prong of § 2254(d)(1).” 533 F.3d 724, 734 (9th Cir.2008) (en banc); Price v. Vincent, 538 U.S. 634, 640, 123 S.Ct. 1848, 155 L.Ed.2d 877 (2003) (explaining that “a decision by a state court is ‘contrary to’ our clearly established law if it ‘applies a rule that contradicts the governing law set forth in our cases’” (citations omitted)). Thus, while we must defer to state courts under AED-PA, we may not permit them to circumvent controlling Supreme Court precedent by resolving federal constitutional issues under their own state evidentiary rules. See Slovik v. Yates, 556 F.3d 747, 754 (9th Cir.2009) (granting habeas petition where the “California Court of Appeal analyzed [the petitioner]’s claim as an evidentiary issue governed by state law, rather than a confrontation question governed by the Sixth Amendment”).
In sum, the California Supreme Court’s decision to deny Cummings’s due process claim is not entitled to AEDPA deference. The court’s analysis of the first Turner factor was objectively unreasonable while its analysis of the second factor was based on an incorrect legal standard and, thus, contrary to federal law. • Because the state court’s resolution of Cummings’s due process claim is not entitled to deference, this court should review that claim de novo. *1154Panetti v. Quarterman, 551 U.S. 930, 953, 127 S.Ct. 2842, 168 L.Ed.2d 662 (2007).
II
Reviewing Cummings’s due process claim de novo, I would grant his petition for habeas relief. La Casella’s testimony was critical to the prosecution’s case against Cummings and, as explained above, the trial record easily demonstrates that he was a “key witness” under Turner ’s first prong. While Turner’s second prong presents a closer question, I would hold that it, too, weighs in Cummings’s favor since La Casella’s contacts with the jury were significant enough to result in prejudice.
First, La Casella served as a bailiff for a much longer period of time than the bailiffs in Turner and Beto. Although La Ca-sella may not have socialized with the jurors to the extent that the bailiffs did in those cases, he served as bailiff for more than three months during voir dire and continued to serve throughout the first week and a half of witness presentations. 'In contrast, the bailiffs in Turner served for only a three-day trial while the bailiff in Beto served for only a one-day trial. The Seventh Circuit has specifically pointed to Beto as a basis for granting habeas relief to a petitioner who had been convicted of robbery based on the testimony of a bailiff who served for just one day of trial. Agnew v. Leibach, 250 F.3d 1123, 1132 (7th Cir.2001) (granting habeas petition under pre-AEDPA law based on the bailiffs “continuous association [with the jury] throughout the first day of a two-day trial”). Notably, the Seventh Circuit granted the petition even though the record did not “reveal whether the [bailiff] accompanied any jurors to lunch” or contain any other “information about the deputy’s out-of-court contact with the jurors.” Id.
The nature of La Casella’s contacts with the jury likewise suggests that his testimony was unduly prejudicial. He testified that jurors had asked him roughly two dozen questions throughout the course of the trial, that he sometimes greeted jurors as they entered the courtroom, and that he unlocked the jury room for them on a handful of occasions. Although these encounters might have seemed inconsequential when La Casella was merely a bailiff, once he became the prosecution’s star witness, these interactions would have likely taken on added significance for at least some jurors. The standard for determining whether those interactions were permissible under Turner is not whether they rose to some abstract level of intimacy. Rather, the proper inquiry is whether it “would have undermined the basic guarantees of trial by jury to permit this kind of an association between the jurors and [a] key prosecution witness[ ]” who was not a bailiff. Turner, 379 U.S. at 474, 85 S.Ct. 546; see also Beto, 405 U.S. at 1055, 92 S.Ct. 1503 (Stewart, «I, concurring) (quoting the same language from Turner).
In this case, the length and nature of La Casella’s association with the jury would have likely precluded him from serving as a witness had he not been assigned to the courtroom as a bailiff during Cummings’s trial. Indeed, it is difficult to imagine another witness being permitted to testify after interacting with jurors, however briefly, on more than two dozen occasions over the course of such a lengthy trial. Cf. Agnew, 250 F.3d at 1132 (“This was not a chance encounter on an elevator but was a continuous association throughout the first day of a two-day trial.”). The fact that these interactions occurred while La Ca-sella was serving as a bailiff — tasked sper cifically with ensuring the jury’s safety— *1155only compounds the risk of prejudice.4 See Turner, 379 U.S. at 474, 85 S.Ct. 546 (“[T]he role that Simmons and Rispone played as deputies made the association even more prejudicial. For the relationship was one which could not but foster the jurors’ confidence in those who were their official guardians during the entire period of the trial.”).
For these reasons, I would hold that La Casella’s testimony infringed Cummings’s due process rights and would grant his petition for habeas relief.
. Of the nine eyewitnesses who testified at trial, only one claimed to see Cummings fire the first shot at Officer Verna from the car. That witness had failed to identify Cummings as the shooter on two prior occasions — during both a police lineup and grand jury proceedings — and admitted that he had previously lied under oath. The witness also admitted that he had changed his testimony to implicate Cummings only after he and a detective conducted a "walk-through” of the shooting following the preliminary hearing.
. Although the first prong of Turner — considering the significance of the bailiffs testimony — requires something akin to a traditional probative-value analysis, the focus of Turner nevertheless remains distinct from the admis*1153sibility question. After all, the two Turner factors are not weighed against each other but, rather, assessed independently, as the majority explains. See Op. at 1142-43 (emphasizing that “the contacts requirement in Turner is independent of the key witness requirement and stands on its own”). To the extent that the California Supreme Court did consider the two Turner factors together here, its decision would not be entitled to AEDPA deference because, as explained above, its resolution of the first Turner prong was unreasonable.
. Although the majority suggests that the state court’s application of the evidentiary balancing test was separate from its application of the Turner test, the language and structure of the opinion suggest otherwise. The state court specifically cited the balancing test in the middle of its discussion of Turner and Beto and, as noted above, situated its analysis of these cases within a broader discussion of the trial court's “Evidentiary Rulings.” The court's reliance on the balancing test therefore appears central — not merely incidental— to its resolution of the Turner issue.
. The prosecution itself may have sought to exploit this potential prejudice. In its closing argument, it stressed that La Casella was "a deputy sheriff who acted as security in this courtroom,” and told the jury, "if you don't convict [Cummings] of first-degree murder with special circumstances, you are telling Deputy La Casella in effect that he lied. I don't think you believe that.”