OPINION
HAMILTON, Circuit Judge:The State of South Carolina (State) appeals from the conditional grant of a writ of habeas corpus issued by the district court *1258setting aside the state conviction of petitioner-appellee, Irvin Jefferson Wilson (Wilson). For reasons stated below, we affirm.
I
As a result of a fire in his residence located in Greenville, South Carolina, Edward Mee-kins moved into his sister’s home in Greer, South Carolina. While living at his sister’s home, Meekins kept all of his possessions that had not been damaged in the fire in the front room and the kitchen of his house in Greenville. Thereafter, William Tate and Claude Walker observed an individual inside Meekins’ house.
As Tate and Walker approached the front of the house, they yelled for the individual to come out. At that time, Wilson walked out the back door. Wilson, who had both hands in ■ his pockets, stated he was a friend of Meekins and was looking for him.
Tate and Walker then entered the house. They noticed that the front door was pried open and the front room had been rummaged through. They also observed a trash can on the back porch that contained clothing items, kitchen utensils, coal, and wood. The police were then called to the house.
After the police arrived at the house, they proceeded to search for Wilson. Wilson was discovered hiding in some bushes near Mee-kins’ house and was arrested. Wilson told the arresting officer that he thought Meekins was dead and that his property had been abandoned. Wilson handed over some items taken from the house.
Wilson was indicted for second degree burglary of a dwelling in violation of S.C.Code Ann. § 16-11-312(A) (§ 16-11-312CA)).1 In pertinent part, the indictment charging Wilson with a violation of § 16-11-312(A) reads:
INDICTMENT FOR BURGLARY (DWELLING) SECOND DEGREE VIOLATION § 16-11-312(A)
That Irvin Jefferson Wilson did in Green-ville County on or about December 18, 1988, willfully and unlawfully enter the dwelling of Ed Mekin [sic] without consent and with intent to commit a crime therein.
Joint Appendix (J.A) at. 112. At the commencement of the trial, the State sought to proceed under two distinct theories of second degree burglary: (1) unlawful entry of a “dwelling,” in violation of § 16 — 11—312(A); and (2) unlawful entry of a “building,” in violation of S.C.Code Ann. § 16-11-312(B) (§ 16-11-312(B)).2
Prior to closing arguments and jury instructions, the following colloquy occurred between the solicitor, defense counsel and the trial court:
Solicitor: Let me bring up one matter about as far as what your charge will be on a dwelling and a building. In other words, what I’m getting at, is this something the jury’s going to have to find right here that he was — or is — I’m trying to know if I need to make comments to the jury about these two—
The Court: Well, actually, is there any question in this case but what this was a dwelling wherein someone lived. There really is no issue to that, is there, Mr. Walsh?
Mr. Walsh: Even under a most liberal reading of State v. Ferebee, I don’t think there’s any indication of a permanent abandonment. I will not even ask the Court to charge that it had been abandoned. I think the—
The Court: Well, if that’s the case, if the only issue is whether or not he had any intent to steal if he was inside the house, and that would be the only issue, then those indictments would not go to the jury. Solicitor: Okay. Well, in—
The Court: There’d be no need to charge—
Solicitor: In other words, you’re going to tell them whether this is a dwelling or a building. I mean it could be either one or *1259we just don’t even have an argument about it, that it’s a dwelling.
The Court: I’m saying that it’s a dwelling. I don’t see that there’s any issue concerning that. I mean I’ll charge the — that portion of second degree, entering a dwelling with intent to steal or commit some other crime but I just don’t see how they could—
Mr. Walsh: Your Honor, I—
The Court: And you’re not going to argue the fact that it is not a dwelling, so—
Mr. Walsh: No sir. I would believe — I would believe that the proper charge would be a building with the enhancement. In other words, we would have burglary in the second degree two ways. Either a dwelling or a building with enhancement. The State has elected by introducing the prior convictions to go with a building and enhancement.
The Court: No, I don’t think—
Solicitor: I’m going both ways. I mean—
The Court: Do you want to go both ways, Mr. Walsh?
Mr. Walsh: Your Honor, I prefer to go only on the — I prefer, obviously, to go neither way, but I believe the state has elected to go under building with enhancement.
The Court: No, I think that the state can go on the other, but I was simply trying to keep away from the jury the prior convictions but if you want it both ways— Solicitor: That’s what I would prefer, to charge them that it can be burglary in either way, you find it either way.
The Court: Okay.
J.A. at 85-87.
Thereafter, the trial court gave the following instruction:
Under Section 16-11-312 of our Code of Laws, burglary in the second degree can occur in one of four ways. Insofar as this case is concerned, only two would be applicable and the first of which of these, burglary in the second degree is the entering of a dwelling in the day time without consent and with the intent to commit a crime therein. Or, secondly, it is the entering of a building in the day time without consent and with the intent to commit a crime therein where the person entering has a prior record of two or more convictions for burglary, housebreaking or a combination of the two. Now, in either instance, the statute says that there must be an intent to commit a crime therein and the state must prove that this defendant, if he entered this house, had the intent to commit a crime once inside but the intended crime need not have been actually committed or accomplished. With respect to the two provisions, the one, entering a dwelling; the other, entering a building. The statute defines dwelling as being a structure wherein someone sleeps or the living quarters of a building used or normally used for sleeping, living or lodging by a person. The statute defines building as being any structure, vehicle, watercraft or aircraft where any person lodges or lives or where people assemble for business, government, education, religion, entertainment, public transportation, public use or where goods are stored.
So, ladies and gentlemen, the state, in order to prove this defendant guilty, must prove either one of two things with respect to burglary in the second degree. First of all, that this defendant entered a dwelling in the day time without consent and with the intent to commit a crime once inside or, secondly, that he entered a building in the day time without consent and with the intent to commit a crime once inside and that he has a prior record of two or more convictions of burglary, housebreaking or a combination of the two.
J.A. at 96-98. Wilson did not object to the trial court’s instructions. The jury found Wilson “guilty as charged” by a general verdict.3
Wilson appealed his conviction to the Supreme Court of South Carolina. The Supreme Court of South Carolina upheld Wilson’s conviction for second degree burglary under Supreme Court Rule 23 and the following authorities: State v. Munn, 292 S.C. *1260497, 357 S.E.2d 461 (1987); State v. Pace, 43 S.C.L. (9 Rich) 355 (1856). State v. Irvin Jefferson Wilson, 91-MO-45 (S.C. March 4, 1991).
On May 7, 1991, Wilson filed a petition for a writ of habeas corpus pursuant to 28 U.S.C. § 2254 alleging, among other things, that his second degree burglary conviction violated his Fifth Amendment right to be indicted before trial and his Fourteenth Amendment right to due process. The district court referred the case to a United States Magistrate Judge for a report and recommendation. In his report and recommendation, the magistrate judge recommended to dismiss the petition on the grounds that no constitutional deprivation occurred, citing Ashford v. Edwards, 780 F.2d 405 (4th Cir.1985).
After Wilson filed timely objections to the magistrate judge’s report and recommendation, the district court granted Wilson a writ of habeas corpus, conditioned on the State’s decision to retry Wilson or appeal to this court. In its order, the district court initially noted that the indictment charged Wilson with a violation of § 16-11-312(A), second degree burglary of a dwelling. The district court then concluded that because the jury was also instructed on the elements of § 16-11-312(B), second degree burglary of a building, which differed from those of second degree burglary of a dwelling, the indictment had not informed Wilson that he was also required to defend against the charge of second degree burglary of a building in violation of his “Fifth Amendment right not to be held to answer for an infamous crime for which he was not indicted and his Sixth Amendment right to be informed of the nature and cause of the accusation against him.” J.A. at 170.
The State noted a timely appeal.
II
The thrust of Wilson’s argument is that the trial court’s instructions constructively amended the indictment and allowed the jury to convict him of a crime not alleged in the indictment in violation of his constitutional rights. As previously noted, the indictment in this case charged Wilson specifically with a violation of South Carolina Code Ann. § 16-11-312(A), second degree burglary of a dwelling.4 In addition, Wilson was neither charged with any of the other burglary in the second degree alternatives contained in South Carolina Code Ann. § 16-11-312, including the burglary of a building, nor with a general violation of § 16-11-312, ie., without reference to a subsection of that section.
We begin our discussion by recognizing that deficiencies in state court indictments “are not ordinarily a basis of federal habeas corpus relief unless the deficiency makes the trial so egregiously unfair as to amount to a deprivation of the defendant’s right to due process.” Ashford, 780 F.2d at 407. We believe that the constructive amendment of the indictment that occurred in Wilson’s state court trial amounted to a deprivation of Wilson’s due process rights.
A safely guarded embodiment of the Sixth Amendment5 and Fourteenth Amendment right to due process is the right of a criminal defendant to have notice of the *1261charges pending against him. Cole v. Arkansas, 333 U.S. 196, 68 S.Ct. 614, 92 L.Ed. 644 (1948) (“No principle of procedural due process is more clearly established than that notice of the specific charge, and a chance to be heard in a trial of the issues raised by that charge, if desired, are among the constitutional rights of every accused in a criminal proceeding in all courts, state or federal.”). A constructive amendment, sometimes referred to as a fatal variance, denies a criminal defendant this fundamental guarantee. See e.g., Hunter v. State of New Mexico, 916 F.2d 696, 698-60 (10th Cir.1990), cert. denied, 111 S.Ct. 1693 (1991).6
An unconstitutional amendment of the indictment occurs when the charging terms are altered, either literally or constructively, such as when the trial judge instructs the jury. United States v. Helmsley, 941 F.2d 71, 89 (2d Cir.), cert. denied, — U.S. -, 112 S.Ct. 1162, 117 L.Ed.2d 409 (1991). In contrast, a variance occurs when the charging terms are unaltered, but the evidence offered at trial proves facts materially different from those alleged in the indictment. Id. It is important to note here the distinction between a constructive amendment of the indictment which is per se reversible error and a variance between the indictment and proof, which does not compel reversal of the conviction if the variance is harmless. Id.
The classic example of a constructive amendment case is Stirone. In Stirone, the grand jury indicted Stirone on a charge of obstructing shipments of sand into Pennsylvania by means of extortion in violation of the Hobbs Act. However, the government also introduced evidence that the defendant had obstructed the export of steel out of Pennsylvania through extortion. In- its charge, the trial court' instructed the jury that it could convict Stirone if it found that he had obstructed shipments of sand into Pennsylvania or obstructed shipments of steel out of Pennsylvania through extortion. The Supreme Court reversed Stirone’s conviction, concluding that the jury might have convicted Stirone of using extortion to obstruct steel exports out of Pennsylvania, a separate offense not alleged in the indictment. Stirone, 361 U.S. at 217-19, 80 S.Ct. at 273-74.
A classic example of a variance case is Moore v. United States, 612 F.2d 1255 (4th Cir.1975). In Moore, the' defendant was charged with possessing a firearm, namely a sawed-off shotgun, in violation of 26 U.S.C. § 5861(d). The government’s proof at trial was different from that alleged in the indictment — the firearm proved not to be a shotgun, but rather a “ ‘firearm made by inserting a 11 inch piece of galvanized pipe into barrel of flare gun and. welding the same with solder-[sic]’ ” Id. at 1256. Thus, the essential elements of the crime of possessing a firearm under 26 U.S.C. § 5861(d) remained the same, but the facts introduced at trial materially differed from those alleged in the indictment. Employing variance analysis, we upheld the conviction on the basis of the defendant’s failure to demonstrate prejudice from the variance. Id.
In the present case, the State’s proof at trial and the trial court’s instructions unquestionably effectuated a constructive amendment of the indictment. It is clear *1262from examining the statute at issue that the elements of burglary of a “dwelling” and burglary of a “building” are materially different. Because Wilson was charged only with the burglary of a dwelling and not the burglary of a building, the State was not entitled to offer proof of this separate offense, nor was the trial court at liberty to instruct the jury on the elements of that separate offense. Thus, to prevent a profound deprivation of Wilson’s due process rights Wilson’s conviction on the burglary count must be reversed.
Ill
From the extended colloquy between counsel for the State, Wilson’s trial counsel, and the trial court set out supra, it is evident that Wilson’s trial counsel acquiesced, if not in fact requested, the instruction tendered by the trial court. We are left with the question, which we raise sua sponte, whether the “invited error” doctrine requires vacation of the district court’s conditional grant of the writ of habeas corpus. The “invited error” doctrine is “a branch of the doctrine of waiver by which courts prevent a party from inducing an erroneous ruling and later seeking to profit from the legal consequences of having the ruling set aside.” Fryman v. Federal Crop Ins. Corp., 936 F.2d 244, 249 (6th Cir.1991) (citation and internal quotes omitted). Thus, courts apply the doctrine to prevent a party from complaining about an error caused by that party. United States v. Lopez-Escobar, 920 F.2d 1241, 1246 (5th Cir. 1991); Guam v. Alvarez, 763 F.2d 1036, 1038 (9th Cir.1985).
However, the doctrine is not without exception. A court is required to reverse a conviction, despite the “invited error” in “exceptional circumstances.” United States v. Sckaff, 948 F.2d 501, 506 (9th Cir.1991). To demonstrate exceptional circumstances, the party inviting the error must demonstrate that reversal “is necessary to preserve the integrity of the judicial process or to prevent a miscarriage of justice.” Alvarez, 763 F.2d at 1038 (citing Marshall v. United States, 409 F.2d 925, 927 (9th Cir. 1969)). We find no compelling reason not to find that a conviction engendered through a constructive amendment of an indictment — which is a clear violation of one of the most safeguarded rights embodied in the Sixth and Fourteenth Amendments — would result in a miscarriage of justice. Accordingly, the “invited error” doctrine does not compel us to reverse the district court’s conditional grant of the writ of habeas corpus.7
IV
To sum up, we agree with the district court that the State’s proof at trial and the trial court’s instructions constructively amended the indictment. We also conclude that the invited error doctrine does not require reversal of the district court’s conditional grant of a writ of habeas corpus. Accordingly, the district court’s decision, conditionally granting a writ of habeas corpus, is affirmed.
AFFIRMED.
. Wilson was also charged with petit larceny.
. A conviction under § 16-11-312(B) requires establishing two prior convictions for burglary or housebreaking or a combination of both. Without objection, the State introduced Wilson's two prior convictions for burglary.
. Wilson was also convicted of petit larceny.
. S.C.Code Ann. § 16-11-312 provides:
Burglary; second degree.
(A) A person is guilty of burglary in the second degree if the person enters a dwelling without consent and with intent to commit a crime there.
(B) A person is guilty of burglary in the second degree if the person enters a building without consent and with the intent to commit a crime therein, and either:
(1)When, in effecting entry or while in the building or in the building or in immediate flight therefrom, he or another participant in the crime:
(a) Is armed with a deadly weapon or explosive; or
(b) Causes physical injury to any person who is not a participant in the crime; or
(c) Uses or threatens the use of a dangerous instrument; or
(d) Displays what is or appears to be a knife, pistol, revolver, rifle, shotgun, machine gun, or other firearm; or
(2) The burglary is committed by a person with a prior record of two or more convictions for burglary or housebreaking or a combination of both; or
(3) The entering or remaining occurs in the nighttime.
(C)Burglary in the second degree is a felony punishable by imprisonment for not more than fifteen years, provided, that no person convicted of burglary in the second degree shall be eligible for parole except upon service of not less than one-third of the term of the sentence.
. U.S. CONST, amend. VI provides:
*1261In all criminal prosecutions, the accused shall enjoy the right ... to be informed of the nature and cause of the accusation.
. In federal criminal cases, constructive amendments to indictments also run afoul of the Fifth Amendment right to be indicted by a grand jury. See Stirone v. United States, 361 U.S. 212, 215— 17, 80 S.Ct. 270, 272-73, 4 L.Ed.2d 252 (1960). Because this case concerns a state criminal prosecution, this protection has no application here. See Hurtado v. California, 110 U.S. 516, 534-35, 4 S.Ct. 111, 120-21, 28 L.Ed. 232 (1884) (due process clause of the Fourteenth Amendment does not incorporate Fifth Amendment right to be charged by a grand jury indictment). We note, however, that S.C. CONST, art. I, § 11 provides: "No person may be held to answer for any crime the jurisdiction over which is not within the magistrate's court, unless on a presentment or indictment of a grand jury of the county where the crime has been committed, except in cases arising in the land or naval forces or in the militia when in actual service in time of war or public danger.” This right to be charged by an indictment is also codified in S.C.Code Ann. § 17-19-10. The Supreme Court of South Carolina has held that "[a] defendant in a criminal case is entitled to be tried on the charges set forth in the indictment.” Munn, 357 S.E.2d at 462. In light of our decision, we need not decide if these provisions in fact create some type of liberty interest entitled to protection. •
. The dissent infra at 1266 would confine the definition of "miscarriage of justice" employed in invited error cases to the definition employed by the Supreme Court in cases involving procedural default. We are reluctant to employ such a narrow standard in this case because the error was fully preserved and not defaulted. In no way does our decision here alter the preclusive effect of the "miscarriage of justice” exception ("actual innocence" exception) applied to procedurally defaulted claims.