
489 S.E.2d 239 (1997)
25 Va. App. 434
Charles A. HIGHSMITH, Jr.
v.
COMMONWEALTH of Virginia.
Record No. 1120-96-4.
Court of Appeals of Virginia, Alexandria.
August 19, 1997.
*240 Robert R. Sparks, Jr., McLean (Matthew Scott McConnell; Herge, Sparks & Christopher, on briefs), for appellant.
(James S. Gilmore, III, Attorney General; John K. Byrum, Jr., Assistant Attorney General, on brief), for appellee.
Present: FITZPATRICK and OVERTON, JJ., and DUFF, Senior Judge.
FITZPATRICK, Judge.
On March 21, 1996, Charles A. Highsmith, Jr. (appellant) was convicted by the Circuit Court of Arlington County (trial court) in a jury trial of driving while intoxicated (DWI) in violation of Code § 18.2-266. The sole issue on appeal is whether the general district court's (district court) pretrial dismissal of the DWI warrant precluded the Commonwealth, under the doctrine of res judicata or the related plea of autrefois acquit, from indicting appellant for the same offense. For the following reasons, we reverse the decision of the trial court.

BACKGROUND
In the early morning hours of May 7, 1995, appellant was stopped for a suspected DWI. He was given a blood test that showed his blood alcohol content exceeded the statutory limit. Appellant was then charged by warrant with driving while intoxicated in violation of "Section 14.2-1/18.2-266, Code or Ordinances of this city, county, or town." Additionally, appellant's operator's license was suspended pursuant to the administrative license suspension (ALS) provisions of Code § 46.2-391.2.
On May 11, 1995, the district court ruled on appellant's motion to review the suspension of his license under Code § 46.2-391.2(C). The district court determined that the police did not have probable cause to arrest appellant, restored appellant's driving privileges, and returned his license.
On June 6, 1995, the district court heard argument on appellant's motion to dismiss the DWI warrant, in which appellant contended that the Double Jeopardy Clause of the Fifth Amendment and the doctrine of collateral estoppel barred further prosecution for DWI subsequent to the suspension of his driver's license. By letter opinion and order dated June 16, 1995, the district court found as follows:
It simply cannot be said that the DWI and ALS are part of a single, unified proceeding.... Despite the fact that they start at approximately the same time, they result in two separate but independent proceedings.
The district court further concluded that "the sanction of ALS constitutes punishment" and the subsequent prosecution for DWI was not punishment "meted out as a part of a single proceeding."[1] Accordingly, the district court granted appellant's motion to dismiss, citing the Double Jeopardy Clause's prohibition against multiple punishments for the same offense.
After the district court's dismissal, appellant was indicted on August 21, 1995 by a circuit court grand jury for the same DWI *241 offense. Appellant filed a new motion to dismiss. On February 7, 1996, the trial court denied appellant's motion to dismiss for the following reasons:
My problem was the word dismissal, as to whether that was a trial, whether it equaled a trial on the merits, whether it was a verdict, whether it did in fact end any attempt by the Commonwealth to do what the defendant said was an end run and indirect appeal, if you will, by indicting in the Circuit Court on the dismissed charges.
The defense counsel in each of these cases submitted authorities.... The Court[][has] considered it at great length and concludes that [the district court's] decision was not a verdict. It was never a dismissal on the merits. It did not put the defendants in the jeopardy that would justify double jeopardy plea.
Therefore, the motion to dismiss is denied in all pending cases in which they are under advisement.
Appellant was convicted of DWI on March 21, 1996.

RES JUDICATA
First, appellant contends that the doctrine of res judicata bars his later indictment on the identical charge that was dismissed by the general district court. Appellant argues that because the doctrine of collateral estoppel applies in criminal proceedings, so too does res judicata, as both doctrines are based on the conclusiveness of a court's judgment and the estoppel effect of the judgment.[2] The application of res judicata in a criminal context is an issue of first impression in Virginia.

Res judicata is a judicially created doctrine founded upon the "considerations of public policy which favor certainty in the establishment of legal relations, demand an end to litigation, and seek to prevent harassment of parties." Res judicata literally means a "matter adjudged," and it precludes relitigation of a claim or issue once a final determination on the merits has been reached by a court of competent jurisdiction. It rests upon the principle that a person should not be required to relitigate the same matter a second time "with the same person or another so identified in interest with such person that he represents the same legal right, precisely the same question, particular controversy, or issue, which has been necessarily tried and fully determined, upon the merits, by a court of competent jurisdiction...."
Commonwealth ex rel. Gray v. Johnson, 7 Va.App. 614, 617-18, 376 S.E.2d 787, 788 (1989) (citations omitted) (emphasis added); accord Bates v. Devers, 214 Va. 667, 670-71, 202 S.E.2d 917, 920-21 (1974); Patterson v. Saunders, 194 Va. 607, 611, 74 S.E.2d 204, 207, cert. denied, 345 U.S. 998, 73 S.Ct. 1132, 97 L.Ed. 1405 (1953).
A person seeking to assert res judicata as a defense must establish identity of: (1) the remedies sought; (2) the cause of action; (3) the parties; and (4) the quality of the persons for or against whom the claim is made. Johnson, 7 Va.App. at 618, 376 S.E.2d at 789. Further, to assert this defense, the party must establish that "the judgment in the former action [was] rendered on the merits by a court of competent jurisdiction." Simmons v. Commonwealth, 252 Va. 118, 120, 475 S.E.2d 806, 807 (1996) (emphasis added).
A judgment is not res judicata if it does not go to the merits of the case....
By a judgment "upon the merits" is not meant "on the merits" in the moral sense of those words. It is sufficient that the status of the suit was such that the parties might have had their suit disposed of on its merits if they had presented all their evidence and the court had properly understood *242 the facts and correctly applied the law to the facts. It is therefore sufficient if the merits are actually or constructively determined.
As to what constitutes a decision on the merits, a decision of an issue of law on a demurrer is a decision on the merits and constitutes res judicata as to any other proceedings where the same parties and the same issues are involved....
* * * * * *
A dismissal of a cause of action may constitute a judgment on the merits depending upon the grounds upon which such dismissal is based. A judgment of dismissal which is intended to be and is a disposition on the merits of a claim is a final judgment on the merits.
8B Michie's Jurisprudence, Former Adjudication or Res Judicata § 12 (1996) (emphasis added). Each of the above requirements is met in the case at bar.
Although we have yet to apply this doctrine in the criminal context, it is well recognized by federal jurisdictions and other states that "[t]he doctrines of res judicata and collateral estoppel apply to criminal, as well as civil, proceedings." United States v. Cejas, 817 F.2d 595, 598 (9th Cir.1987); see generally E.H. Schopler, Annotation, Modern Status of Doctrine of Res Judicata in Criminal Cases, 9 A.L.R.3d 203 (1996). Additionally,
[i]n most jurisdictions it is well settled that the doctrine of collateral estoppel is applicable in criminal cases, that is, that the criminal nature of a proceeding does not, ipso facto, preclude a judgment rendered therein from operating as collateral estoppel in another criminal prosecution. As applied in criminal cases, the primary significance of the doctrine of res judicata lies in its operation as collateral estoppel, since the doctrine of collateral estoppel, differently from the defense of double jeopardy and "former acquittal" or "former conviction," is applicable irrespective of whether the former and the later proceeding are based on the same offense. However, most of the cases discussing the doctrine involve related offenses, that is, offenses arising out of the same occurrence or transaction.
Schopler, supra, at § 5(a).
Moreover, the doctrine of res judicata has been applied to a pretrial dismissal on the merits. See Cejas, 817 F.2d at 599 (holding that a pretrial dismissal of an indictment was a final decision on the merits that barred further prosecution and that "[t]he granting of a motion to dismiss based upon double jeopardy ... would have the effect of putting an end to all further prosecution"). See also United States v. Oppenheimer, 242 U.S. 85, 87-88, 37 S.Ct. 68, 69, 61 L.Ed. 161 (1916) (a case in which the Supreme Court determined that "a judgment for the defendant upon the ground that the prosecution is barred goes to his liability as a matter of substantive law, and one judgment that he is free as matter of substantive law is as good as another."). The Oppenheimer Court further held that "[a] plea of the statute of limitations is a plea to the merits" and explained that:
It cannot be that a judgment of acquittal on the ground of the statute of limitations is less a protection against a second trial than a judgment upon the ground of innocence, or that such a judgment is any more effective when entered after a verdict than if entered by the government's consent before a jury is empaneled....
* * * * * *
[T]he Fifth Amendment was not intended to do away with what in the civil law is a fundamental principle of justice in order, when a man once has been acquitted on the merits, to enable the government to prosecute him a second time.
Id. at 87, 37 S.Ct. at 69 (citations omitted). See also United States v. Blackwell, 900 F.2d 742, 745 (4th Cir.1990) (stating that the doctrines of res judicata and collateral estoppel are "implicated by the pretrial disposition of a prior case if an ultimate issue in the second prosecution was conclusively litigated and necessarily determined as part of the judgment entered in the first case"); United States v. Byars, 762 F.Supp. 1235, 1237 (E.D.Va.1991) ("the doctrines of res judicata and collateral estoppel apply in criminal cases ... and more particularly, to pretrial dispositions of issues in criminal cases").
*243 We see no reason to bar the application of this doctrine to the issue in the instant case: the second prosecution of a criminal case dismissed by a substantive pretrial judgment by a court which had jurisdiction to determine the case on its merits.[3] Accordingly, we find that the Commonwealth's contention that no decision on the merits was encompassed by the general district court's dismissal on double jeopardy grounds is without merit.
In the instant case, the prosecution on the indictment in the trial court involved the same charge and the same parties as did the prosecution on the warrant in the general district court. Subsequent to the general district court's dismissal of the charge on double jeopardy grounds, both this Court and the Supreme Court of Virginia rejected the district court's rationale.[4] Although the district court's dismissal was based on a principle of law that was later determined to be erroneous, its dismissal was nevertheless a final ruling on the merits of the case. To hold otherwise would improperly allow the defendant's rights to be contingent on the correctness of the judge's actions. See, e.g., Slagle v. Slagle, 11 Va.App. 341, 346, 398 S.E.2d 346, 349 (1990) (a judgment is conclusive even though manifestly wrong in law or fact); Nicholas v. Commonwealth, 186 Va. 315, 320, 42 S.E.2d 306, 309 (1947) (the power to decide includes the power to decide wrongly and an erroneous decision is as binding as one that is correct). See also 8B Michie's Jurisprudence, Former Adjudication or Res Judicata § 10 (1996) ("A judgment on the merits, fairly rendered, by a court of competent jurisdiction, having cognizance both of the parties and the subject matter, however erroneous it may be, is conclusive on the parties and their privies until reversed or set aside in a direct proceeding for that purpose, and it is not amenable to collateral attack.") (emphasis added); Thomas v. Consolidation Coal Co., 380 F.2d 69, 80 n. 16 (4th Cir.), cert. denied, 389 U.S. 1004, 88 S.Ct. 562, 19 L.Ed.2d 599 (1967) ("A judgment on the merits is res judicata even though erroneous.").
Thus, in the instant case, res judicata barred the indictment and subsequent trial of appellant in the circuit court for the same offense that had been dismissed previously by the general district court.

AUTREFOIS ACQUIT
As a corollary to his defense of res judicata, appellant asserts the additional plea of autrefois acquit and relies upon the cases of Adkins v. Commonwealth, 175 Va. 590, 9 S.E.2d 349 (1940), and Commonwealth v. Perrow, 124 Va. 805, 97 S.E. 820 (1919). However, we find that the plea of autrefois acquit does not control the case at bar.
This plea is generally recognized as being subsumed within the Double Jeopardy Clause. See generally 2C Michie's Jurisprudence, Autrefois, Acquit and Convict § 1 et seq. (1996). It is well settled "`that jeopardy means the danger of conviction.' Equally well settled is the principle that jeopardy attaches `[i]n a trial before a court without a jury ... when the trial has reached the stage where the Commonwealth begins to introduce its testimony.'" Courtney v. Commonwealth, 23 Va.App. 561, 567, 478 S.E.2d 336, 338 (1996) (quoting Rosser v. Commonwealth, 159 Va. 1028, 1036, 167 S.E. 257, 259 (1933)); see also Greenwalt v. Commonwealth, 224 Va. 498, 500-01, 297 S.E.2d 709, 710 (1982). In the instant case, it is undisputed that jeopardy had not attached at the time of the district court's disposition of the case. Further, the United States Supreme Court made clear in United States v. Scott, 437 U.S. 82, 98 S.Ct. 2187, 57 L.Ed.2d 65 (1978), that the disposition of the instant case is not to be categorized as an "acquittal."
"Autrefois acquit" literally means "formerly acquitted" and is defined as "[t]he name of a plea in bar to a criminal action, stating that the defendant has been once *244 already indicted and tried for the same alleged offense and has been acquitted." Black's Law Dictionary 123 (6th ed.1997). The Supreme Court addressed the application of autrefois acquit in Adkins v. Commonwealth, 175 Va. 590, 9 S.E.2d 349 (1940), a case involving a prosecution for bigamy. The first indictment against the defendant charged him with one count of bigamy and a second count of aiding and abetting the commission of the crime of bigamy. The defendant, "upon his arraignment, demurred" to the first indictment on the ground that, being an unmarried person, he was not included within the statute defining bigamy and that as a matter of law, he therefore could not be an accessory to the crime of bigamy. Adkins, 175 Va. at 594, 9 S.E.2d at 350. The court, by order, sustained the demurrer to the indictment and "`to each count thereof,'" and discharged the defendant from the indictment. Id. at 594-95, 9 S.E.2d at 350.
Subsequently, the defendant was arraigned on a second indictment charging him with aiding and abetting the commission of the crime of bigamy. Upon his arraignment, the defendant filed a plea of autrefois acquit, alleging that "having been acquitted on the merits and discharged from custody [on the first indictment], he should not be required to answer the second indictment." Id. at 595, 9 S.E.2d at 351. However, the trial court sustained the Commonwealth's demurrer to the defendant's plea, and he was tried and convicted on the second indictment. Id.
On appeal, the Supreme Court interpreted the defendant's plea as "founded solely on the legal proposition that having once been acquitted on the merits and discharged ... he [was] protected from further prosecution." Id. at 596, 9 S.E.2d at 351 (emphasis added). The Court found that the Commonwealth's demurrer, alleging that the "discharge" of the defendant under the first indictment had not been established, was "untenable" and held as follows:
There is not a syllable [in the order sustaining the demurrer] which indicates that the demurrer was sustained without prejudice. There is not a word in it which indicates that the demurrer was sustained on the ground that it was defective in form. The court, as evinced by the order, sustained the demurrer as to each count thereof on the ground relied upon by the accused and discharged him "without day." This, in our opinion, was an ultimate decision upon a question of law....

Adkins, 175 Va. at 596, 9 S.E.2d at 351 (emphasis added).
In so holding, the Adkins Court relied upon its previous decision in Commonwealth v. Perrow, 124 Va. 805, 97 S.E. 820 (1919). In Perrow, the defendant was convicted and fined upon a warrant issued by a justice of the peace. He appealed to the circuit court, and that court, finding the statute under which the defendant was charged to be "unconstitutional and void," "quashed and dismissed the warrant." Id. at 808, 97 S.E. at 821. The Commonwealth then appealed the circuit court's determination to the Supreme Court. While basing its decision, in part, on the principle that the Commonwealth had no right to appeal the dismissal of the defendant's warrant, the Court also held the following:
There was no jury trial in the instant case, and we have not overlooked the fact that jeopardy, as ordinarily understood in legal parlance, refers to the danger of conviction and punishment which a defendant incurs in a criminal case where a jury has been empaneled and sworn. But we are of the opinion that the spirit and purpose of the immunity intended to be secured by the doctrine in question [former jeopardy] will be violated whenever a defendant in any criminal case has been formerly tried by competent authority  whether court or jury  and discharged upon a defense constituting a bar to the proceeding, whether that defense be rested upon the law or the facts.
Perrow, 124 Va. at 815, 97 S.E. at 823 (emphasis added).[5] The Court dismissed the *245 Commonwealth's writ of error and the defendant prevailed. Id. at 816, 97 S.E. at 823.
The Supreme Court of Virginia has yet to overrule either of these cases; however, we interpret the holding and analysis of the United States Supreme Court in United States v. Scott, 437 U.S. 82, 98 S.Ct. 2187, 57 L.Ed.2d 65 (1978), decided subsequent to Perrow and Adkins, to be determinative of the application of autrefois acquit under the circumstances of the instant case. In Scott, the Court held that for double jeopardy purposes "a defendant is acquitted only when `the ruling of the judge, whatever its label, actually represents a resolution [in the defendant's favor], correct or not, of some or all of the factual elements of the offense charged.'" Scott, 437 U.S. at 97, 98 S.Ct. at 2198 (quoting United States v. Martin Linen Supply Co., 430 U.S. 564, 571, 97 S.Ct. 1349, 1354, 51 L.Ed.2d 642 (1977)) (emphasis added). The Court explained that no double jeopardy concern is implicated where no factual determination is rendered but the case is terminated, because the reason for treating a termination obtained by a defendant "of the proceedings against him in the trial court without any finding by a court or jury as to his guilt or innocence" is that such defendant "has not been `deprived' of his valued right to go to the first jury." Scott, 437 U.S. at 100, 98 S.Ct. at 2198. Thus, "[n]o interest protected by the Double Jeopardy Clause is invaded when the Government is allowed to appeal and seek reversal of such a midtrial termination of the proceedings in a manner favorable to the defendant." Id.; accord Greenwalt v. Commonwealth, 224 Va. 498, 500, 297 S.E.2d 709, 710 (1982) ("The double jeopardy provisions ... protect against a second prosecution for the same offense after an acquittal. A dismissal qualifies as an acquittal for double jeopardy purposes when it is granted pursuant to a factual, as opposed to legal defense."); Dodson v. Commonwealth, 23 Va.App. 286, 303, 476 S.E.2d 512, 520 (1996) (holding that a dismissal of an indictment for procedural defects does not qualify as an acquittal for double jeopardy purposes because it was granted pursuant to a legal, as opposed to factual, defense).
While we hold that the second prosecution is not barred by the plea of autrefois acquit, it is encompassed by the related bar of res judicata. Accordingly, for the foregoing reasons, the decision of the trial court is reversed.
Reversed.
NOTES
[1]  The general district court's finding that the ALS proceeding raised double jeopardy concerns in a subsequent prosecution was later determined by this Court and by the Supreme Court to be an erroneous principle of law. See Brame v. Commonwealth, 252 Va. 122, 476 S.E.2d 177 (1996) (holding the automatic license suspension under Code § 46.2-391.2 is a remedial sanction whose purpose is "so clear and compelling that it overrides any incidental punitive effect the provision may have"); accord Nicely v. Commonwealth, 23 Va.App. 327, 477 S.E.2d 11 (1996); Tench v. Commonwealth, 21 Va.App. 200, 462 S.E.2d 922 (1995).
[2]  It is well recognized in Virginia that "the doctrine of collateral estoppel is a constitutional requirement embodied in the fifth amendment protection against double jeopardy and is applicable to the states through the fourteenth amendment to the United States Constitution." Simon v. Commonwealth, 220 Va. 412, 415, 258 S.E.2d 567, 569 (1979). "`The doctrine of collateral estoppel in criminal cases ... means "that when an issue of ultimate fact has once been determined by a valid and final judgment, that issue cannot again be litigated between the same parties in any future lawsuit."`" Jones v. City of Lynchburg, 23 Va.App. 167, 171, 474 S.E.2d 863, 865 (1996) (quoting Rogers v. Commonwealth, 5 Va.App. 337, 341, 362 S.E.2d 752, 754 (1987)).
[3]  The doctrine of res judicata applies to the instant case because it involves the pretrial dismissal of a misdemeanor by the general district court. Clearly, this doctrine has no applicability either to a general district court's finding of no probable cause at a felony preliminary hearing or to a later straight indictment on the same charge.
[4]  See supra note 1.
[5]  The Perrow Court concluded that, as a general rule, the Commonwealth has no right to appeal from a judgment in a defendant's favor absent express statutory authority. See Perrow, 124 Va. at 815, 97 S.E. at 823. Since that time, the General Assembly has provided certain appeal rights to the Commonwealth. See, e.g., Code § 19.2-398. However, this code section is inapplicable to the case at bar.
