*446Opinion
FLIER, J.Appellant Arthur Vasilyan was charged by the Los Angeles County District Attorney in 1994 with three counts of a violation of Penal Code section 422.7 (section 422.7). He pleaded nolo contendere to two counts; the third count was dismissed. Appellant was placed on probation on the conditions that he would serve 39 days in county jail, pay a fine, and Serve 80 hours of community service. No appeal was taken from the judgment of conviction.
On June 21, 2007, appellant, through his counsel, filed a motion to vacate the judgment and for leave to withdraw his guilty plea. Alternatively, the motion sought relief in terms of petitions for writs of coram nobis, habeas corpus, and audita querela. In large part, the motion relied on People v. Wallace (2003) 109 Cal.App.4th 1699 [1 Cal.Rptr.3d 324] (Wallace), which held that section 422.7 is only a penalty provision; we set forth the entirety of section 422.7 in the margin.1 An amended motion, much to the same effect as the original motion, was filed on December 7, 2007. The motion was denied. This appeal is from the denial of the motion entered on December 12, 2007. We agree with appellant that the judgment entered in 1994 is void. We vacate appellant’s plea of nolo contendere and remand with directions to amend or dismiss the information, as appears appropriate.
FACTS
1. The Facts Underlying the Plea of Nolo Contendere
Our summary of the facts is based on the transcript of the preliminary hearing held on September 12, 1994.
Kiger Hansen and his friend Jason Bane were on Santa Monica Boulevard in Los Angeles when, at approximately 2:00 a.m. on August 28, 1994, a *447group of four or five men began abusing them verbally by calling them “fags” and physically attacked Hansen and Bane. Hansen was hit on the jaw, knocking a tooth loose, and he was also hit on the side of his head. Hansen identified appellant as one of the men who beat Bane. All five attackers continued to yell outrageous taunts intended to demean Hansen and Bane. They also challenged Hansen and Bane to fight, but the two men managed to get away.
Appellant and his cohorts were almost immediately arrested; the attack took place at what Hanson testified was a “hot spot” with a lot of people about and a Los Angeles County Sheriff’s Department station across the street. Hansen and Bane identified their attackers within 15 minutes of the attack.
2. The Consequences of the Plea of Nolo Contendere
Appellant was 20 years old in August 1994. He was represented by retained counsel in the proceedings that led to his pleas. One of his contentions in support of the motion to vacate the judgment is that his counsel did not advise him of the immigration law consequences of his pleas.
Appellant currently resides in Yerevan City in Armenia. He entered the United States in 1988 with his family and became lawfully a permanent resident. He was deported in 2004 because of the pleas of nolo contendere in 1994. According to a declaration by an immigration law specialist submitted in support of the motion to vacate the judgment, his pleas in 1994 subjected appellant to three immigration law consequences. They are deportation, exclusion from admission to the United States, and denial of naturalization as a United States citizen.
DISCUSSION
1. Wallace, supra, 109 Cal.App.4th 1699
In Wallace, supra, 109 Cal.App.4th 1699, 1701-1702, the defendant was charged with assault, robbery and battery. It was also alleged that the crimes were hate crimes in terms of Penal Code section 422.75 and that the assault and robbery charges constituted serious felonies for purposes of sentence enhancement. Pursuant to a negotiated disposition, the prosecution amended the information to allege a violation of section 422.7. The defendant pleaded nolo contendere to this charge, in exchange for which the remaining counts were dismissed; the defendant did not plead to any other charge or charges. The sentence was suspended, the defendant was placed on felony probation for three years, and he served 60 days in county jail. Unlike in the case *448before us, the defendant appealed from the judgment, contending that section 422.7 “is merely a penalty provision for which he cannot be punished in the absence of a conviction on a related substantive offense.” (Wallace, supra, 109 Cal.App.4th at p. 1701.)
After noting that in In re M.S. (1995) 10 Cal.4th 698, 725 [42 Cal.Rptr.2d 355, 896 P.2d 1365], the California Supreme Court characterized section 422.7 as a penalty enhancement provision (Wallace, supra, 109 Cal.App.4th at p. 1702), the Wallace court found that section 422.7 does not “identify any particular substantive crime” but rather elevates certain crimes from misdemeanors to felonies, which makes section 422.7 “plainly a penalty provision.” (Wallace, at pp. 1702-1703.) The court went on to analyze section 422.7 from perspectives that we need not repeat here; suffice it to say that this analysis only confirmed the conclusion that section 422.7 is a penalty provision and that section 422.7 does not identify or establish a substantive crime.
The court then turned to the question of the appropriate remedy. We set forth this part of the court’s opinion in full: “Having concluded that section 422.7 is a penalty provision, we now turn to the question of the appropriate remedy to be applied. Wallace contends that his conviction should be reduced to a misdemeanor violation of section 422.6. The People, by contrast, assert that Wallace’s conviction and sentence should be affirmed because his plea was knowing, voluntary and intelligent. Neither position is persuasive. First, Wallace is not entitled to have his conviction reduced to a misdemeanor because his sentence reflects his understanding that he was pleading to a felony. As the People correctly note, to reduce Wallace’s sentence under the circumstances would unfairly compromise the negotiated settlement upon which the parties had agreed. (People v. Bean (1989) 213 Cal.App.3d 639, 645 [261 Cal.Rptr. 784].) Second, we cannot affirm a conviction and sentence imposed for a crime that does not exist, notwithstanding the defendant’s consent. (See People v. Soriano (1992) 4 Cal.App.4th 781, 785 [6 Cal.Rptr.2d 138] [‘where fundamental jurisdiction is lacking, it cannot be conferred by consent or estoppel’].) Because Wallace’s plea to a violation of section 422.7 is a legal nullity, the judgment must be reversed.” (Wallace, supra, 109 Cal.App.4th at p. 1704.)
Significantly, the appellate court’s order in Wallace was to vacate the defendant’s plea, to order the dismissed counts reinstated, and to remand the matter “for plea or trial, as appropriate.” (Wallace, supra, 109 Cal.App.4th at p. 1704.)
*4492. The Judgment Convicting Appellant of Violations of Section 422.7 Must Be Vacated
(a) The Statutory Framework
“No person can be punished for a public offense, except upon a legal conviction in a Court having jurisdiction thereof.” (Pen. Code, § 681.) “A crime or public offense is an act committed or omitted in violation of a law forbidding or commanding it, and to which is annexed, upon conviction, either of the following punishments: [j[] 1. Death; [f] 2. Imprisonment; [][] 3. Fine; [j[] 4. Removal from office; or, [f] 5. Disqualification to hold and enjoy any office of honor, trust, or profit in this State.” (Pen. Code, § 15.) In relevant part, Penal Code section 6, enacted in 1872, provides: “No act or omission, commenced after twelve o’clock noon of the day on which this Code takes effect as a law, is criminal or punishable, except as prescribed or authorized by this Code . . . .” “ ‘There is no criminal common law in California. All public offenses or crimes are statutory, and unless there is in force at the time of the commission or omission of a particular act a statute making it a crime or a public offense, no one can be adjudged to suffer punishment for its commission or omission.’ ” (In re Harder (1935) 9 Cal.App.2d 153, 155 [49 P.2d 304].)
(b) The Statutory Framework Explained
The subject matter jurisdiction of a California court presiding over a criminal prosecution is predicated on the offense. “To constitute jurisdiction in a criminal case there must be two elements, namely, jurisdiction of the person, and jurisdiction of the subject matter or, as it is sometimes called, of the offense.” (Burns v. Municipal Court (1961) 195 Cal.App.2d 596, 599 [16 Cal.Rptr. 64].) “The most important is jurisdiction of the subject matter. ‘No person can be punished for a public offense, except upon a legal conviction in a court having jurisdiction thereof.’ (P.C. 681.) In other words, the court in a criminal trial, like the court in a civil proceeding, must have jurisdiction of the subject matter (in criminal cases, the offense).” (4 Witkin & Epstein, Cal. Criminal Law (3d ed. 2000) Jurisdiction and Venue, § 1, p. 86, citing, inter alia, Burns v. Municipal Court, supra, 195 Cal.App.2d at p. 599.)
“Section 15 of the Penal Code defines a crime: ‘A crime or public offense is an act committed or omitted in violation of a law forbidding or commanding it, and to which is annexed, upon conviction, either of the following punishments: [listing various punishments].’ There must then exist both prohibited or commanded acts and punishment for violation thereof; without both, there is no crime.” (People v. Crutcher (1968) 262 Cal.App.2d 750, 754 [68 Cal.Rptr. 904].) That there must be a substantive crime and a *450punishment for that crime in order to constitute a criminal offense has been long recognized. (E.g., People v. McNulty (1892) 93 Cal. 427, 437 [29 P. 61].)
It follows that if there is no crime, the court lacks subject matter jurisdiction. This conclusion is compelled not only by the statutes and cases interpreting those statutes, this conclusion comports with fundamental principles of justice. The notion that a person can be punished under the criminal law for committing an act that is not a crime is entirely outside our system of jurisprudence. This is not to say that appellant may very well have committed a crime or crimes such as assault and battery under circumstances that are particularly offensive and blameworthy. Nonetheless, the fact remains that the act with which he was charged is not a crime.
The foregoing principles validate the conclusions of the court in Wallace that the court lacked subject matter jurisdiction, that a court “cannot affirm a conviction and sentence imposed for a crime that does not exist” (Wallace, supra, 109 Cal.App.4th at p. 1704) and that the plea in that case was a “legal nullity.”
(c) A Void Judgment Is Subject to Collateral Attack
It is fundamental and it cannot be questioned that a judgment that is void for lack of subject matter jurisdiction is subject to collateral attack. “Moreover, lack of jurisdiction will render the judgment void, and subject not only to reversal on appeal but to collateral attack, motion to vacate, or extraordinary writ. (See 2 Cal. Proc. (4th), Jurisdiction, §387; 8 Cal. Proc. (4th), Attack on Judgment in Trial Court, §6 et seq.; 8 Cal. Proc. (4th), Extraordinary Writs, §§39, 50; 6 Cal. Crim. Law (3d), Criminal Writs, §85.)” (4 Witkin & Epstein, Cal. Criminal Law, supra, Jurisdiction and Venue, § 1, p. 86.) Lack of jurisdiction in its most fundamental sense means an entire absence of power to hear or determine the case, i.e., an absence of authority over the subject matter or the parties. When a court lacks jurisdiction in a fundamental sense, an ensuing judgment is void, and such a judgment is vulnerable to direct or collateral attack at any time. (People v. American Contractors Indemnity Co. (2004) 33 Cal.4th 653, 660 [16 Cal.Rptr.3d 76, 93 P.3d 1020].) This is a venerable rule of long standing. (E.g., Conlin v. Blanchard (1933) 219 Cal. 632, 635-636 [28 P.2d 12]; Chipman v. Bowman (1859) 14 Cal. 157, 158-159.)
In Andrews v. Superior Court (1946) 29 Cal.2d 208, 209 [174 P.2d 313] (Andrews), the defendant pleaded guilty in 1935 in the Police Court of the City of Stockton to contributing to the delinquency of a minor, in violation of Statutes 1915, chapter 631, section 21, the “Juvenile Court Law,” which is *451now found in the Welfare and Institutions Code. The court first held that the then existing police courts did not have jurisdiction to enforce juvenile court law. (Andrews, supra, 29 Cal.2d at p. 213.) A void judgment may be attacked “ ‘anywhere, directly or collaterally whenever it presents itself, either by parties or strangers. It is simply a nullity, and can be neither a basis nor evidence of any right whatever.’ ” (Id. at pp. 214-215.) The court concluded that a writ of mandate directing the trial court to “strike the judgment ... is the proper remedy.” (Id. at p. 215.) It is noteworthy that the conviction in Andrews was over 10 years old when the mandate was issued by the Andrews decision, i.e., that judgment was long since final yet it was set aside by a writ of mandate.
(d) The Dissent
Our dissenting colleague writes that “there is no question that the superior court in the present case had the authority to proceed on charges brought against a defendant like Vasilyan based on assaultive felony conduct committed in the court’s territorial jurisdiction.” (Dis. opn., post, at p. 461.)
There are three erroneous premises in this conclusion.
First. The court did not have authority to proceed on charges based on “assaultive felony conduct.” There is no such crime as “assaultive felony conduct.” The court could proceed on charges of assault (Pen. Code, § 240) and/or battery (Pen. Code, § 242) and other variations of assault and battery recognized by the Penal Code. The point is that none of these offenses was charged.
Second. The court’s subject matter jurisdiction had to be predicated on the charged offense, which must be one set forth in the Penal Code. (See pts. 2.(a) & (b) of the Discussion, ante.) The term used by the dissent, “assaultive felony conduct,” suggests, erroneously, that there is such a thing as a nonstatutory common law crime in California.
Third. The reference to the court’s “territorial jurisdiction” introduces an irrelevant consideration. Territorial jurisdiction “is the nonfundamental, waivable aspect of jurisdiction” (People v. Klockman (1997) 59 Cal.App.4th 621, 627 [69 Cal.Rptr.2d 271]) and it is not to be confused with subject matter jurisdiction.2 There is no issue in this case about the court’s territorial jurisdiction. If the implicit suggestion is that territorial jurisdiction is the same as subject matter jurisdiction, we disagree.
*452The dissent states that this court concluded that fundamental jurisdiction was lacking in 1994 because the Wallace decision held, years later, that the “criminal allegations in Vasilyan’s case were mislabeled.” (Dis. opn., post, at p. 461.)
Wallace did not hold that “criminal allegations” were “mislabeled.” Wallace held that section 422.7 does not set forth a crime in that it does not set forth a substantive offense. Nor is it legally accurate to say that in Vasilyan’s case there were “criminal allegations.” There were allegations that Vasilyan had violated the Penal Code, but the provisions of that code that he was alleged to have violated do not set forth a crime. Finally, and most importantly, this court does not conclude that there was an error in labels. There was an error in the alleged offense that was charged, i.e. the alleged offense that was charged was not a crime under the Penal Code. As Wallace, supra, 109 Cal.App.4th at page 1704 points out, a person cannot be convicted of a crime that does not exist.
The cases cited by our dissenting colleague are, in our view, distinguishable.
In People v. Level (2002) 97 Cal.App.4th 1208, 1210 [119 Cal.Rptr.2d 551], the defendant was charged with grand theft and forgery and a with prior strike conviction for robbery. The defendant contended that the prior strike should be treated as a juvenile adjudication because she was, in fact, a juvenile when she had pleaded guilty to robbery. The appellate court rejected this contention, principally on the ground that the defendant had waived her right to have the robbery prosecution proceed in juvenile court. (Id. at p. 1211.) Subject matter jurisdiction simply was not an issue in People v. Level.
The same is true of People v. Collins (1996) 45 Cal.App.4th 849 [53 Cal.Rptr.2d 367] and In re Griffin (1967) 67 Cal.2d 343 [62 Cal.Rptr. 1, 431 P.2d 625]; neither decision involves subject matter jurisdiction. In People v. Collins the issue was whether the trial court could vacate, on the People’s motion, a commitment to the California Youth Authority that had been entered in accordance with a plea agreement; the defendant had not complied with his side of the agreement. (People v. Collins, supra, at p. 862.) The appellate court concluded that the trial court had the jurisdiction to entertain such a motion. (Id. at p. 864.) The jurisdiction at issue was the power to entertain a motion to vacate; the issue was not fundamental subject matter jurisdiction, which was not challenged. In In re Griffin, the claim was that the trial court lacked jurisdiction to revoke probation; the Supreme Court expressly rejected the contention that this was a matter of subject matter jurisdiction. (In re Griffin, supra, at p. 347.)
*453Finally, People v. Ellis (1987) 195 Cal.App.3d 334, 336-337 [240 Cal.Rptr. 708], was a case in which the defendant was charged with burglary, four counts of vehicle theft and eight counts of passing bad checks. The defendant admitted a prior conviction for bank robbery in federal court. It turned out that the federal offense did not include all of the elements of the parallel crime under California law. On appeal, the defendant claimed that the admission of the prior federal conviction was invalid. The trial court’s subject matter jurisdiction over the multiple charged California offenses was not at issue. The question was one of law, i.e., whether the admission of the prior federal conviction was valid in that the elements of the federal and the parallel California offense were not the same. While there was no question that the federal conviction was lawful, it was error to treat that conviction as a California prior conviction; the court went on to conclude that this error was waived. In any event, the trial court’s subject matter jurisdiction rested on the charged California offenses and was not predicated on the federal conviction.
The cases cited by the dissent involve instances of courts acting, arguably, in excess of jurisdiction. This conforms with the dissent’s conclusion that at most the present case is one when the court acted in excess of its jurisdiction.3 But when there is no crime under the Penal Code, there is no subject matter jurisdiction. (See pt. 2.(a) & (b) of the Discussion, ante.)
Finally, we have explained in part 2.(c) why the void judgment before us is subject to collateral attack. Thus, contrary to the dissent’s conclusion, it is immaterial that appellant did not raise this defect in a prior direct appeal.
We agree with the dissent that the petitions for writs of habeas corpus, coram nobis and audita querela are unavailable for the reasons stated by the dissenting opinion. Specifically, for the purposes of his petition for a writ of habeas corpus, appellant does not satisfy the requirement that he must be in custody or that he is otherwise deprived of his liberty. (People v. Villa (2009) 45 Cal.4th 1063, 1072 [90 Cal.Rptr.3d 344, 202 P.3d 427].) And, as noted in the dissent, the writ of error coram nobis is not available for the fundamental reason that this writ applies “where a fact unknown to the parties and the court existed at the time of judgment that, if known, would have prevented rendition of the judgment.” (People v. Kim (2009) 45 Cal.4th 1078, 1093 [90 Cal.Rptr.3d 355, 202 P.3d 436].) The matter at hand is an error of law, which is not cognizable in a coram nobis proceeding. (Ibid.) We also agree with the dissent that it is questionable that audita querela is available in this case but we need not address this issue. Under the facts and circumstances of this *454case, a motion to vacate the judgment is the proper procedural vehicle to raise the defect of a lack of subject matter jurisdiction.
3. Respondent’s Contentions Are Without Merit
In considering respondent’s contentions, we note preliminarily that it is no small matter to set aside a criminal conviction that is long since final. In the rare instance when this happens, the People are put into the position of having to decide whether to retry a case that was long closed or of not proceeding at all. This is likely to be a difficult decision. On the other hand, prejudice and inconvenience cannot be taken into account when a court is faced with a void judgment. The interest that is protected by a collateral attack on a void judgment is not only the defendant’s personal interest. Ultimately, the interest that is at stake is the integrity of the judicial system itself. A conviction resting on a void judgment simply cannot stand.
With this in mind, we address respondent’s claim that appellant cannot now contend that section 422.7 is only a penalty provision because he could have advanced this contention in an appeal from the judgment. As the authorities establish without ambiguity or contradiction, the court lacked subject matter jurisdiction in 1994 in that section 422.7 is only a penalty provision. Accordingly, the judgment is void. And a void judgment may be attacked collaterally at any time, as we have shown.
Respondent also contends that appellant is without a remedy in that a writ of error coram nobis will only set aside a guilty plea induced by mistake, fraud or coercion and, as appellant is not in custody, he cannot avail himself of a petition for a writ of - habeas corpus. Respondent also claims that appellant cannot avail himself of a petition for a writ of audita querela. While we agree, it is also true that appellant may move to vacate the void judgment, which is exactly what he did. He sought to rely on these extraordinary writs only in the alternative.
4. The Terms of Our Remand
We decline to dismiss the case against appellant or to order the trial court to do so. On this record, we cannot say whether or under what circumstance the information might be amended. Accordingly, we remand with directions to amend or dismiss the information, as appears to the trial court to be appropriate.
*455DISPOSITION
The judgment of conviction and appellant’s pleas of nolo contendere are vacated. The case is remanded with directions to amend or dismiss the information, as appears appropriate, and for such further proceedings as are appropriate.
Rubin, Acting P. J., concurred.
In 1994, then section 422.7 stated: “Except in the case of a person punished under Section 422.6, any crime which is not made punishable by imprisonment in the state prison shall be punishable by imprisonment in the state prison or in a county jail not to exceed one year, by a fine not to exceed ten thousand dollars ($10,000), or by both that imprisonment and fine, if the crime is committed against the person or property of another for the purpose of intimidating or interfering with that other person’s free exercise or enjoyment of any right secured to him or her by the constitution or laws of this state or by the Constitution or laws of the United States and because of the other person’s race, color, religion, ancestry, national origin, disability, gender, or sexual orientation, under any of the following circumstances, which shall be charged in the accusatory pleading: [][] (a) The crime against the person of another either includes the present ability to commit a violent injury or causes actual physical injury. H] (b) The crime against property causes damage in excess of five hundred dollars ($500). ffl (c) The person charged with a crime under this section has been convicted previously of a violation of subdivision (a) or (b) of Section 422.6, or has been convicted previously of a conspiracy to commit a crime described in subdivision (a) or (b) of Section 422.6.” (Italics omitted.)
“ ‘The jurisdictional power of a court to act is conceptually divided into subject matter and territorial jurisdiction.’ ” (People v. Gbadebo-Soda (1995) 38 Cal.App.4th 160, 169 [45 Cal.Rptr.2d 40].)
The dissent notes that the cases cited at 4 Witkin and Epstein, California Criminal Law, supra, Jurisdiction and Venue, section 8, page 95 are instructive. The cited section in this treatise deals with “Estoppel To Attack Excess of Jurisdiction.” (Ibid.)