GLICKMAN, Associate Judge:
In December 1996, appellant Dave Magnus entered unconditional pleas of guilty to charges of carrying a pistol without a license, possession of an unregistered fire-arm, and unlawful possession of ammunition. The charges were based on evidence that he possessed handguns and handgun ammunition in his home. Magnus was sentenced to a one-year term of probation, and he took no appeal. Eleven years later, however, in District of Columbia v. Heller,1 the Supreme Court held that the District's general ban on possession of usable handguns in the home violated the Second Amendment. Magnus moved to set aside his convictions, arguing inter alia that in light of Heller, his guilty pleas were invalid because he was misinformed of what the government would have to prove in order to convict him, constitutionally, of the charged crimes. The trial court denied him relief, primarily on the ground that Magnus had waived his Second Amendment claims by pleading guilty.
On appeal, Magnus contends the trial court erred in denying his claims without a hearing. We agree. By voluntarily entering an unconditional guilty plea, a defendant waives non-jurisdictional defects in the proceedings leading up to the plea, including otherwise available constitutional defenses. Nonetheless, the defendant still may challenge the validity of the plea itself by showing that it was not voluntarily or intelligently made. While Magnus failed to raise such a challenge in a direct appeal of his convictions, he may be able to make the evidentiary showing required to overcome that procedural default and establish that he is entitled to relief to correct a miscarriage of justice, i.e., his conviction for conduct that under the Second Amendment could not be criminalized. We remand for an evidentiary hearing on these issues.2
I.
On March 30, 1996, police executed a search warrant at a residence located at 814 Decatur Street, N.W. They discovered two loaded handguns in a room in the basement. Outside that room, elsewhere in the basement, the police found one pound of marijuana and $9,900 in cash. Magnus, who was present at the time of the search, admitted to possessing the weapons and was arrested. He later signed a typed confession (prepared by the police), in which he stated:
I own both the .357 cal pistol and the .45 caliber semi-auto pistol found in my room. I bought both pistol [sic] on the street from two unknown people. The.357 I paid $150.00 for and the .45 cal pistol I paid $250.00 for. I bought them because I was robbed in front of my house (814 Decateur [sic] St. N.W.). I don't own or sell the marijuana found in 814 Decateur [sic] St. N.W. that belongs to Chris Ferguson who lives there but wasn't home. I rent a room from Chris's mother in 814 Decateur [sic] St. N.W. Washington D.C. If someone came to the house to rob the marijuana from Chris I would use my guns to protect the marijuana and Chris from being harmed.[3]
Magnus was charged by information with one count of carrying a pistol without a license (CPWL),4 two counts of possession of an unregistered firearm (UF), two counts of unlawful possession of ammunition (UA), and one count of possession of marijuana with intent to distribute (PWID). On December 6, 1996, he pleaded guilty to each of the weapon and ammunition counts, and the government dismissed the PWID count. The court sentenced Magnus to concurrent one-year terms of probation on each count of conviction. Magnus did not appeal. He finished serving his sentence in early 1998.
There things stood until 2009, when Magnus petitioned for relief from his convictions, pursuant to either D.C.Code § 23-110 (2001) or a writ of error coram nobis, and moved to withdraw his guilty pleas, pursuant to Criminal Rule 32(e).5 Relying on the Supreme Court's decision in Heller invalidating the District's handgun ban under the Second Amendment, Magnus argued that the CPWL, UF, and UA statutes were unconstitutional on their face and as applied to his possession of handguns and ammunition in his home for what he said was "legitimate self-defense."6 He further argued that his guilty pleas were unintelligent and involuntary because "no one, least of all defendant [Magnus], had any idea the Supreme Court would decide in [Heller] that the laws under which defendant was charged, pleaded, and was convicted were unconstitutional."
After hearing from the government, the trial court summarily denied Magnus's motions. Agreeing with the government's main objections, the court found Magnus ineligible for relief under D.C.Code § 23-110 because he was no longer in custody. The court refused to permit Magnus to withdraw his guilty plea pursuant to Criminal Rule 32(e) because, it held, he waived his Second Amendment claims by entering unconditional guilty pleas and therefore could not establish that withdrawal was necessary to correct a manifest injustice. Finally, the court denied Magnus's request for a writ of error coram nobis for three reasons: first, because he had waived his Second Amendment claims by pleading guilty; second, because he suffered no miscarriage of justice on account of that waiver, inasmuch as he "was arrested under circumstances indicating that he was using the firearms and ammunition to protect illegal drugs;"7 and third, because "it cannot be said that the trial court made an error of fact when finding [Magnus's] plea a knowing and voluntary waiver of his rights under then controlling law," given that the Supreme Court had not yet decided Heller when Magnus pleaded guilty. Magnus timely appealed the denial of his motions to this court.8
II.
When Magnus tendered his guilty pleas, the controlling view in this jurisdiction was that the Second Amendment does not guarantee an individual right and "affords [a defendant] no protection whatsoever" in a prosecution for possessing a handgun in violation of the District's CPWL, UF, and UA statutes.9 The Supreme Court overturned those understandings in District of Columbia v. Heller,10 holding that the Second Amendment protects an individual right to keep and bear arms for purposes of self-defense, and that the District's virtually absolute ban on handgun possession in the home violated the Second Amendment. Following Heller, this court in Plummer v. United States11 held it impermissible under the Second Amendment to convict a defendant for possessing an unregistered handgun in the home when the District's unconstitutional ban made registration of a handgun impossible, unless the defendant was disqualified from registering the handgun for constitutionally permissible reasons. In Herrington v. United States,12 we held that the Second Amendment similarly protects possession of handgun ammunition in the home, and that a UA prosecution for such conduct is unconstitutional unless the government proves the defendant was disqualified from exercising his Second Amendment rights. Because these decisions place certain conduct covered by the CPWL, UF, and UA statutes "beyond the power of the criminal law-making authority to proscribe,"13 they apply retroactively to all criminal cases, including those in which the convictions have become final and unreviewable on direct appeal.14 The reason for such retroactive application is that conviction "for an act that the law does not make criminal ... inherently results in a complete miscarriage of justice and presents exceptional circumstances that justify collateral relief...."15
These principles of retroactivity are applicable whether the defendant was convicted after a trial or on a plea of guilty.16 In the latter case, though, a collateral attack based on a defect inhering in the plea must be distinguished from an attack based on the deprivation of constitutional rights suffered by the defendant before the plea was entered. "`It is well settled that a voluntary and intelligent plea of guilty made by an accused person, who has been advised by competent counsel, may not be collaterally attacked.'"17 By entering a guilty plea, a defendant "ordinarily waives all non-jurisdictional defects in the proceedings" leading up to the plea, including constitutional errors.18 Consequently, a defendant cannot "raise independent claims relating to the deprivation of constitutional rights that occurred prior to the entry of the guilty plea."19 By choosing to plead guilty, therefore, Magnus waived his claims that the CPWL, UF, and UA statutes are unconstitutional on their face or as applied to his conduct.20
A defect inhering in the plea is treated differently. Although a defendant who has pleaded guilty is foreclosed from challenging the constitutionality of his convictions directly, he still may "attack the voluntary and intelligent character of the guilty plea" itself.21 "A plea of guilty is constitutionally valid only to the extent it is `voluntary' and `intelligent.'"22 For the plea to be intelligent, the defendant must have obtained "`real notice of the true nature of the charge against him.'"23 If, as in Bousley, the defendant is under the mistaken impression that non-criminal conduct is criminal because "neither he, nor his counsel, nor the court correctly understood the essential elements of the crime with which he was charged"—as those elements are clarified by later judicial decisions—then the defendant's guilty plea is unintelligent and "constitutionally invalid."24 In other words, where a subsequent court ruling makes clear that the defendant's charged conduct was constitutionally protected and could not have been criminalized, a collateral challenge to the validity of the guilty plea is not foreclosed. Magnus presents just such a challenge, asserting he did not know when he pleaded guilty that (per the later decisions in Heller, Plummer, and Herrington) the CPWL, UF, and UA statutes constitutionally could not reach possession of handguns and handgun ammunition in the home for self-defense.
To proceed on this claim, however, Magnus must surmount high procedural and substantive hurdles. Normally, "the voluntariness and intelligence of a guilty plea can be attacked on collateral review only if first challenged on direct review."25 Having never sought direct review of his conviction, Magnus procedurally defaulted his current challenge.26 To overcome that default and pursue his collateral attack, he must demonstrate either (1) "cause" and "actual prejudice," or (2) that he is "actually innocent."27 These procedural requirements overlap with the basic substantive standard Magnus must satisfy to obtain the relief he seeks: under Criminal Rule 32(e), "[a] guilty plea may be withdrawn after sentencing only if the defendant affirmatively establishes that the trial court's acceptance of [his] plea was manifestly unjust, and that the plea proceeding was fundamentally flawed such that there was a complete miscarriage of justice."28
On the current record, it remains an open question whether Magnus can carry his burden of proof to surmount the procedural default and establish his entitlement to relief. The trial court concluded that Magnus cannot demonstrate a miscarriage of justice because he "was arrested under circumstances indicating that he was using the firearms and ammunition to protect illegal drugs"—a use that we may assume would disqualify Magnus from invoking the protections of the Second Amendment.29 But without first having afforded Magnus a hearing on his claims, the court reached that conclusion prematurely. Magnus was entitled to a chance to prove his assertion that he kept his weapons only for self-defense and had nothing to do with the marijuana (which, after all, was not found in the room he rented). In defense of the court's ruling, the government cites a sentence in Magnus's signed statement to the police—"If someone came to the house to rob the marijuana from Chris I would use my guns to protect the marijuana and Chris from being harmed." But Magnus disputes the significance of that hypothetical and arguably ambiguous remark, claiming the police distorted what he actually told them when they wrote it down in the document he signed; and the trial court specifically declined to consider it in ruling against him.30
At this stage, we see no other insurmountable barrier to Magnus's request for a hearing on his challenge to his convictions. The trial court correctly ruled that Magnus could not proceed under D.C.Code § 23-110 because he was no longer "in custody under sentence of the Superior Court" when he filed his petition.31 Rule 32(e) does not contain a similar in-custody requirement, though—as the government notes without taking a position—we have reserved ruling on whether one is implicit.32 We deem it unnecessary to resolve that issue here, because coram nobis relief unquestionably is available to petitioners who are no longer in custody.33
As a court established by Act of Congress, the Superior Court is empowered to issue the writ of error coram nobis by the All Writs Act.34 Coram nobis relief is available only to correct a miscarriage of justice resulting from "errors of the most fundamental character," where no other remedy is available and "sound reasons exist[] for failure to seek appropriate earlier relief...."35 From its inception at early common law, the function of the writ of error coram nobis was to correct crucial factual errors that were unknown to the trial court.36 The court below ruled that Magnus could not secure a writ of error coram nobis because he alleged an error of law by the trial judge rather than an error of fact.
But even if the error claimed by Magnus was a legal one—a misconception by the trial court at the time of the guilty plea as to the conduct constitutionally within the reach of the CPWL, UF, and UA statutes—he still may pursue coram nobis relief. Such relief is no longer limited to the correction of purely factual errors. At least since the Supreme Court resurrected the remedy over half a century ago in Morgan, its scope has expanded to encompass the correction of fundamental legal errors in addition to factual ones.37 The Court recently described modern coram nobis as "an extraordinary tool to correct a legal or factual error."38 And, as a leading treatise observes, federal courts routinely have granted the writ in cases such as this one, "where the applicant demonstrates that his conduct was not criminal under the law as later interpreted by the [Supreme] Court."39 In United States v. Mandel, for example, the Fourth Circuit granted coram nobis relief "in light of a retroactive dispositive change in the law of mail fraud" effected by a subsequent Supreme Court decision.40 Other federal courts of appeals (not to mention federal district courts) have reached the same conclusion.41 A conviction for conduct that is not criminal, but is instead constitutionally-protected, is the ultimate miscarriage of justice.
Reversed and remanded.