
4 Cal.Rptr.3d 609 (2003)
111 Cal.App.4th 1178
The PEOPLE, Plaintiff and Respondent,
v.
Steven PARHAM, Defendant and Appellant.
No. B160306.
Court of Appeal, Second District, Division Six.
September 9, 2003.
*610 Kent Douglas Baker, San Diego, under appointment by the Court of Appeal, for Defendant and Appellant.
Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Pamela C. Hamanaka, Senior Assistant Attorney General, Steven D. Matthews, Supervising Deputy Attorney General, and Mary Sanchez, Deputy Attorney General, for Plaintiff and Respondent.
GILBERT, P.J.
The trial court finds that defendant was not a mentally disordered offender (MDO) *611 at the time he committed a criminal offense. The judgment states that defendant was not an MDO at the time of his prior hearing before the Board of Prison Terms (BPT). Here we hold res judicata bars the prosecution from retrying defendant as an MDO based on the same qualifying offense.
Steven Parham appeals the judgment committing him to the California Department of Mental Health (DMH) as an MDO. (Pen.Code, § 2962.) We reverse.

FACTS
In 1997 Parham threatened to kill his brother and mother. He was convicted of making terrorist threats (Pen.Code, § 422) and sentenced to two years in state prison. On December 21, 1998, the BPT determined that Parham was an MDO. Parham filed a petition to review that determination in the superior court.

The First Case
Doctor Robert Halon, a psychologist, testified that Parham had a long record of crimes going back to 1973 caused by a personality disorder, not a severe mental disorder.
Judge Donald G. Umhofer found that Doctor Halon's testimony was the only "comprehensive explanation" for Parham's criminal history. He rejected 1992, 1993 and 1995 medical reports suggesting that Parham had a severe mental disorder. He rejected the opinions of the doctors the prosecution relied on because "these doctors just haven't been able to figure out what that mental disorder is."
On August 6, 1999, the court entered judgment in favor of Parham finding he was not an MDO "as of the date of the Board of Prison Terms Hearing" and ordered that he be released from the DMH.
On August 17, 1999, Parham committed a parole violation and was incarcerated.
In 2001 the BPT determined that he had a severe mental disorder. Parham filed a petition for a superior court hearing.

The Second Case
Parham filed a motion to "Bar Certification Proceedings" and for summary judgment. He argued res judicata and collateral estoppel applied because the prosecution was relying on the same 1997 qualifying offense it used in the first case.
Judge James D. Ream denied the motions. He stated Judge Umhofer's "implicit holdings or explicit holdings that [Parham] had never suffered from a severe mental disorder" were "surplusage or dicta" and res judicata did not apply.
Doctor William Safarjan, a clinical psychologist, testified that Parham has a "schizoaffective disorder bipolar type," a severe mental disorder. He concluded it was one of the causes or an aggravating factor in his 1997 offense.
Doctor Halon testified Parham did not have a severe mental disorder and the 1997 qualifying offense was unrelated to a severe mental disorder.
The court found Parham was an MDO.

DISCUSSION
Parham contends that principles of double jeopardy, res judicata and collateral estoppel barred the relitigation of the issue involving his mental state at the time of his qualifying offense.
"The principles of double jeopardy are inapplicable ... because the MDO statutory scheme is civil in nature. [Citations.]" (People v. Francis (2002) 98 Cal.App.4th 873, 877, 120 Cal.Rptr.2d 90.) But the doctrines of res judicata and collateral estoppel apply. (Ibid.) They bar the prosecution *612 from relitigating issues that were resolved against it in a final judgment from a prior action involving the same defendant. (Ibid.; Castillo v. City of Los Angeles (2001) 92 Cal.App.4th 477, 481, 111 Cal.Rptr.2d 870.) Here the first and second cases involved the same issues, the same parties and Parham relied on the same expert. The first judgment became final before the second trial.
The Attorney General correctly notes that the issue as to whether Parham has a severe mental disorder may change over time. Therefore res judicata and collateral estoppel do not apply to it. (People v. Francis, supra, 98 Cal.App.4th at p. 879, 120 Cal.Rptr.2d 90.) But other "criteria concern past events that once established, are incapable of change [.]" (Ibid.) One of these is the requirement that the prosecution must prove that the defendant's "severe mental disorder was one of the causes of or was an aggravating factor in the commission of a crime [the qualifying offense] for which the prisoner was sentenced to prison." (Pen.Code, § 2962, subd. (b).) "Thus, where a trial court has found that a severe mental disorder was not an aggravating factor in the commission of the crime, the People are precluded from seeking a second MDO determination based on the same underlying offense." (Francis, at p. 879, 120 Cal.Rptr.2d 90.) That is what happened here.
The Attorney General acknowledges that the prosecution used the same qualifying offense in both cases. He argues, however, that Judge Umhofer decided only that Parham did not have a severe mental disability. He claims there were no findings on whether he had a severe mental disorder at the time of the qualifying offense.
The Attorney General relies on the language in the judgment which says Parham was not an MDO at the time of the BPT hearing. But we must also review the court's findings to determine what other issues were "`necessarily decided.'" (People v. Francis, supra, 98 Cal.App.4th at pp. 877-878, 120 Cal.Rptr.2d 90; Lucido v. Superior Court (1990) 51 Cal.3d 335, 342, 272 Cal.Rptr. 767, 795 P.2d 1223.) If the court decides the case on one issue, the remaining issues were "`necessarily decided'" if they were actually litigated and not "`entirely unnecessary'" to the case. (Lucido, at p. 342, 272 Cal.Rptr. 767, 795 P.2d 1223 [contested indecent exposure issue was necessarily decided in probation violation hearing even though revocation order was based solely on defendant's drug use].)
Judge Umhofer found Doctor Hanlon's testimony persuasive and concluded that Parham did not suffer from a severe mental disorder. Hanlon's testimony established that Parham did not have a severe mental disorder from 1973 to 1998. The court rejected the opinions of all the doctors who concluded that Parham had such a disorder at any time. These findings were not "dicta." They resolved evidentiary conflicts and were the foundation for the judgment. They were tantamount to a finding that Parham did not have a severe mental disorder at the time of the 1997 qualifying offense. That issue was essential to the prosecution because in order to prevail, it had to prove Parham's mental state at that time. (People v. Francis, supra, 98 Cal.App.4th at p. 877, 120 Cal.Rptr.2d 90.) Both sides litigated that issue. The prosecution was not entitled to a second opportunity to prove an element it did not establish in the prior case. (Teitelbaum Furs, Inc. v. Dominion Ins. Co. (1962) 58 Cal.2d 601, 604, 25 Cal.Rptr. 559, 375 P.2d 439.) It could not seek to commit Parham again by using the same 1997 qualifying offense that was an issue in the *613 first case. (Francis, at p. 879, 120 Cal.Rptr.2d 90.)
The judgment is reversed.
We concur: COFFEE and PERREN, JJ.
