Plaintiff-Appellee Dr. Tariq Ahmed brought suit in federal district court against Defendants-Appellants Washington Department of Social and Health Services (“DSHS”) and two of its supervisory employees under 42 U.S.C. § 1983 for al- ’ leged violation of his First Amendment rights. He ultimately won a jury verdict for $8,026,009. We have jurisdiction over this appeal pursuant to 28 U.S.C. § 1291, and we reverse.
I. BACKGROUND
Most of the facts in this case are disputed and, on at least some issues, there may be inconsistent sets of facts that have been found by different tribunals, federal and state. For this reason, we begin with the procedural background.
Ahmed was terminated from his position with DSHS on January 10, 1997. Five days later, he appealed his termination to the state Personnel Appeals Board (“PAB”). On July 1, 1997, while the administrative appeal was still pending, Ahmed filed a complaint against DSHS and two of his superiors in federal district court. All of the claims in the complaint were, in' one way or another, claims for wrongful termination, including a claim for wrongful termination in retaliation for the exercise of his First Amendment rights.
On December 19, 1997, the PAB decided Ahmed’s appeal against him, and Ahmed appealed that determination in state court. Next, a federal jury returned a verdict in favor of Ahmed. Judgment on the verdict was entered on June 17, 1998, and the defendants appealed to this court. Meanwhile, the state trial court found against Ahmed, affirmed the decision of the PAB, and entered judgment on May 10, 1999. Ahmed appealed the decision to the Washington Court of Appeals.
Next, we reversed the district court’s judgment in favor of Ahmed, on the basis of an erroneous evidentiary ruling, and the case was remanded for a new trial. Ahmed v. Washington, No. 98-36202, 1999 WL 1040086 (9th Cir. Nov.16, 1999) (unpublished disposition). On retrial, another federal jury again found for Ahmed. Judgment on that verdict was entered on June 30, 2000, and it is the appeal from that judgment that is now before this court.1
After the notice of appeal from the second federal trial was filed, the state ap*982peals court affirmed the decision of the state trial court, affirming the PAB decision that had gone against Ahmed. Ahmed v. Dep’t of Soc. & Health Servs., No. 24685—6-II, 2000 WL 1174554 (Wash.Ct.App. Aug.18, 2000) (“Ahmed I”). Ahmed’s petition for review to the state supreme court was denied. Ahmed v. Dep’t of Soc. & Health Servs., 142 Wash.2d 1019, 16 P.3d 1265 (2001).
On Ahmed’s theory of the facts, this is essentially a whistleblower case — Ahmed was terminated for speaking out about improper patient care at Rainier School, a DSHS-run residential facility for the disabled, at which Ahmed was employed. He claims that he was never disciplined until immediately after he filed a formal incident report about substandard care at the school. Because the presence of such reports in the school’s records could jeopardize the school’s federal funding, Defendant Leanna Lamb (the school’s superintendent) and Defendant Dr. Rogelio Ruvalca-ba (the school’s clinical director) allegedly conspired to gather trumped-up disciplinary charges against Ahmed and fire him on that basis.
Defendants DSHS, Lamb, and Ruvalca-ba (collectively “Defendants”) argue to the contrary. On their theory of the facts, this case is a straightforward termination for cause. They claim that Ahmed was fired for a number of legitimate reasons. They also argue that the record shows that Ahmed’s problems working with others long predate his alleged whistleblowing.
On appeal, the parties argue the facts of the various incidents at issue in great detail. Fortunately, we need not attempt to reconcile those conflicting positions because the dispositive issue presented by this appeal is the limits of the district court’s jurisdiction.
The PAB, in its review of Ahmed’s termination, found against Ahmed on most of the charges. It further found that these were legitimate bases for Ahmed’s termination, and it upheld the termination on that ground. All of the PAB’s findings of fact and conclusions of law, reviewed under appropriate standards, were affirmed by the state courts.
II. ANALYSIS
As a general matter, lower federal courts do not have authority to review final determinations of state courts. Rather, the only federal forum in which such review can be sought is the United States Supreme Court. See Worldwide Church of God v. McNair, 805 F.2d 888, 890 (9th Cir.1986) (citing 28 U.S.C. § 1257). The Rooker-Feldman doctrine is merely a development of those principles: A federal district court does not have jurisdiction to hear a case that would require the court to review a state court judgment, even if the case presents federal constitutional issues, and even if the state court judgment is not from the state’s highest court. See Dubinka v. Judges of the Superior Court, 23 F.3d 218, 221 (9th Cir.1994); Worldwide Church of God, 805 F.2d at 890, 893 (applying the doctrine to a case in which the appeal of the relevant state trial court judgment was still pending); see generally Dist. of Columbia Court of Appeals v. Feldman, 460 U.S. 462, 103 S.Ct. 1303, 75 L.Ed.2d 206 (1983); Rooker v. Fidelity Trust Co., 263 U.S. 413, 44 S.Ct. 149, 68 L.Ed. 362 (1923). The doctrine encompasses cases in which the issues presented to the federal court are not identical to but are “inextricably intertwined” with determinations made by the state court. See Feldman, 460 U.S. at 483-84 n. 16, 103 S.Ct. 1303; Dubinka, 23 F.3d at 221-22. It also applies to prohibit federal judicial review of state court review of determinations made by state administrative bodies. Feldman, 460 U.S. at 468, 485-86, 103 S.Ct. 1303 (applying the doctrine to a decision of the District of Columbia Court of *983Appeals, upholding a decision of the Committee on Admissions of the District of Columbia Bar).
Rooker-Feldman is jurisdictional. See Olson Farms, Inc. v. Barbosa, 134 F.3d 933, 937 (9th Cir.1998). It consequently cannot be waived. See Fed. R.Civ.P. 12(h)(3) (“Whenever it appears by suggestion of the parties or otherwise that the court lacks jurisdiction of the subject matter, the court shall dismiss the action”). The existence of subject matter jurisdiction is a question of law reviewed de novo. Garvey v. Roberts, 203 F.3d 580, 587 (9th Cir.2000).
In Ahmed’s case, the state trial court’s affirmance of all of the findings of fact and conclusions of law of the PAB occurred before the second federal jury rendered its verdict. If Ahmed’s federal case involved the relitigation of issues already determined by the PAB and, hence, by the state court, or if it involved the litigation of issues that were inextricably intertwined with such issues, then the district court was deprived of subject matter jurisdiction, once the state trial court rendered its decision. In effect, this would mean that Defendants won the “race to judgment” that we recently alluded to in Green v. City of Tucson, 255 F.3d 1086, 1097 (9th Cir.2001). The first judgment, which was in federal court, was reversed on appeal, and the next judgment, which was in state' court and has survived all appeals, was in Defendants’ favor.
On the facts of this case, the question of whether Ahmed’s federal suit involves issues that are identical to or “inextricably intertwined” with issues already determined by the PAB (and hence by the state trial court) is a close one. The only claim in Ahmed’s federal suit that went to the jury was his First Amendment retaliation claim. The PAB decision does not mention any First Amendment issues or state that Ahmed made any such arguments.2 The letter opinion of the state trial court is similarly silent on the First Amendment, although the issue was at least briefly presented to the court orally by Ahmed’s counsel. Had there been nothing further to consider, all of this might suggest that the merits of Ahmed’s federal claim were not determined by the state court, and that the district court therefore had jurisdiction to hear it.
We conclude, nonetheless, that Ahmed’s federal claim presents issues that are at least inextricably intertwined with, if not identical to, those adversely decided by the state court; thus, that the district court lacked jurisdiction. When the Washington Court of Appeals affirmed the state trial court’s decision, it stated that Ahmed had
argued to the [PAB] that Superintendent Lamb initially contemplated a short suspension but was “angry and offended by her belief that Dr. Ahmed was creating difficulty for Rainier School over issues of client care with outside agencies reviewing the situation at Rainier School.” He suggested that, if Lamb’s anger was a substantial factor in the decision to terminate Ahmed, her decision was inappropriate and a violation of his first amendment rights.
Ahmed I, 102 Wash.App. 1002, 2000 WL 1174554, at *11. The court went on to conclude (1) that Ahmed “has not shown that his speech was a substantial motivating factor in the termination decision,” and (2) that the PAB had determined that Lamb terminated him for legitimate reasons. Id. (describing the alleged miscon*984duct, stating that “[f]or these reasons, [Lamb] decided to terminate [Ahmed],” and concluding that the PAB “believed Lamb’s reasons for termination were legitimate”). Thus, as we read the Washington Court of Appeals’ opinion, Ahmed’s First Amendment claim was considered and rejected by the PAB — it rejected his argument that Lamb fired him in retaliation for speaking out about patient care problems, and it determined that her actual reasons for firing him were legitimate.
Ahmed I was decided after the second jury verdict in Ahmed’s favor. But it is still relevant to the assessment of the Rooker-Feldman issue on this appeal because it definitively clarifies which issues were actually litigated by Ahmed before the PAB. According to the Washington Court of Appeals, Ahmed presented his First Amendment claim to the PAB, and the PAB rejected it, finding that he was terminated, not in retaliation for the exercise of his First Amendment rights, but only for legitimate reasons. A Washington trial court affirmed those findings in then-entirety. It was not then open to Ahmed to ask a federal jury to find to the contrary. That is, although the district court had jurisdiction at the time that Ahmed’s complaint was filed, the district court was deprived of jurisdiction under Rooker-Feldman as soon as the state trial court entered judgment against Ahmed.
Ahmed’s principal argument against the application of Rooker-Feldman is that “a final judgment on the merits enforcing Dr. Ahmed’s First Amendment rights was entered in federal court before any state tribunal had rendered a decision on the merits of that issue.” Insofar as Ahmed is referring to the judgment on the first federal jury verdict, the statement is correct but irrelevant — the first judgment was reversed on other grounds and is now of no effect. Insofar as he is referring to the judgment on the second federal jury verdict, the statement is mistaken — as the Washington Court of Appeals found, Ahmed presented his First Amendment claim to the PAB, which rejected it, and the PAB’s decision was affirmed by the state trial court before the second federal jury returned its verdict.
Ahmed also argues that Rooker-Feldman does not apply when “the state proceedings [are] ongoing.” It is true that Rooker-Feldman does not apply if no state court has yet issued a decision. But if the “proceedings are ongoing” only in the sense that the direct appeal from the final judgment of the state trial court is pending, then Rooker-Feldman does apply. Worldwide Church of God, 805 F.2d at 890, 893. Because the state trial court entered judgment before the second jury returned its verdict, Rooker-Feldman applies to Ahmed’s case, even though the state appeal was pending when the verdict was rendered.
Alternatively, we hold that even if the PAB did not decide Ahmed’s First Amendment claim itself, it did decide issues that are inextricably intertwined with that claim. In order to succeed on his First Amendment claim, Ahmed must prove that his speech was a substantial motivating factor in his termination. Mt. Healthy City Sch. Dist. Bd. of Educ. v. Doyle, 429 U.S. 274, 287, 97 S.Ct. 568, 50 L.Ed.2d 471 (1977). If he were to carry that burden, Defendants could still insulate themselves from liability by proving that they would have fired him for legitimate reasons if the proven retaliatory motive had not been present. Id.; see also Texas v. Lesage, 528 U.S. 18, 20-21, 120 S.Ct. 467, 145 L.Ed.2d 347 (1999). Thus, Defendants’ reasons and motivations for firing Ahmed, and the legitimacy of those reasons, were all crucial to Ahmed’s First Amendment claim. Consequently, throughout his federal suit he has sought *985to minimize his disciplinary problems, arguing the facts of all of the alleged instances of misconduct in great detail and seeking to explain away his alleged disciplinary violations. In effect, Ahmed argued to the federal jury that the disciplinary charges against him were largely manufactured or exaggerated by Defendants in order to get rid of him.
These arguments are necessary to the success of Ahmed’s First Amendment claim, because he was required to show that his speech was a substantial motivating factor of his termination, and he needed to overcome Defendants’ showing that without his speech, they would have fired him anyway. The problem is that all of these facts were already found by the PAB, and in Defendants’ favor, and it rejected Ahmed’s versions of the incidents in question. Because the facts found by the PAB thus go to the heart of Ahmed’s First Amendment claim, we conclude that Ahmed’s claim is inextricably intertwined with the PAB’s factual findings, which were affirmed by the state trial court before the second federal jury returned its verdict. Under Rooker-Feldman, therefore, the district court did not have jurisdiction over Ahmed’s suit.
III. CONCLUSION
Because we conclude that the district court lacked jurisdiction at the time that it rendered its judgment, the judgment of the district court is VACATED and the case is REMANDED to the district court with instructions to DISMISS the action. Costs to appellants.
. We have, in the meantime, dismissed a separate, prior appeal from a pretrial order of the district court on remand, because that order was not an appealable, final order.
. Ahmed’s Supplemental Excerpts of Record include a few pages of the transcript of the administrative hearing, and Ahmed relies on them as evidence that the PAB "specifically precluded [Ahmed] from asserting an issue relating to his First Amendment claims.” The excerpt from the transcript does not support that claim.