
59 P.3d 488 (2002)
Roy A. O'GUINN, Appellant,
v.
The STATE of Nevada, Respondent.
Robert Rodney Presfield, Appellant,
v.
The State of Nevada, Respondent.
Nos. 37300, 38382.
Supreme Court of Nevada.
December 20, 2002.
Marcus D. Cooper, Public Defender, and Catherine A. Woolf, Howard S. Brooks, and Joseph K. Abood, Deputy Public Defenders, Clark County, for Appellant O'Guinn.
Steven G. McGuire, State Public Defender, and James P. Logan, Chief Deputy Public Defender, Carson City, for Appellant Presfield.
Frankie Sue Del Papa, Attorney General, Carson City; Stewart L. Bell, District Attorney, James Tufteland, Chief Deputy District Attorney, and Frank J. Coumou, Deputy District *489 Attorney, Clark County, for Respondent in Docket No. 37300.
Frankie Sue Del Papa, Attorney General, Carson City; Richard W. Sears, District Attorney, White Pine County, for Respondent in Docket No. 38382.
Before the Court En Banc.

OPINION
PER CURIAM.
In separate proceedings, both appellants entered pleas of guilty but mentally ill. Appellants appeal and present the issue as to whether our decision in Finger v. State[1] automatically entitles a defendant convicted pursuant to a guilty but mentally ill plea to withdraw that plea and proceed to trial.[2]

FACTS

O'Guinn v. State, Docket No. 37300
Roy O'Guinn entered a plea of guilty but mentally ill to an amended information charging him with two counts of burglary, one count of open and gross lewdness, and two counts of sexual assault on a victim sixty-five years of age or older. The original information included one additional count of open and gross lewdness and three additional counts of sexual assault on a victim sixty-five years of age or older that were dropped as part of the plea agreement. O'Guinn allegedly committed the offenses after entering the rooms of both victims while wandering through a hospital.
Pursuant to NRS 178.425, the district court ordered O'Guinn committed to Lakes Crossing and suspended all proceedings until such time as O'Guinn was found competent to stand trial. O'Guinn was subsequently found competent, and he entered a plea of not guilty. After extensive negotiations, he entered a plea of guilty but mentally ill to all counts in the amended information.
On each of the four felony counts, O'Guinn was sentenced, under the habitual criminal statute, to concurrent life sentences with parole eligibility after ten years. O'Guinn was also required to be on lifetime supervision and register as a sex offender. On the gross misdemeanor count, he was sentenced to one year, concurrent with the life sentences.
O'Guinn did not attempt to withdraw his plea in district court. O'Guinn appeals directly to this court, pursuant to this court's decision in Finger, seeking to withdraw his plea, enter a plea of not guilty by reason of insanity, and proceed to trial.

Presfield v. State, Docket No. 38382
Presfield was originally charged with murder in the stabbing death of Paul Swope in Ely, Nevada. Three doctors examined Presfield, finding him competent to stand trial. The State filed an amended information against Presfield charging him with battery with intent to kill, with the use of a deadly weapon. Presfield entered a plea of guilty but mentally ill to the charge.
The district court sentenced Presfield to 240 months in prison with the possibility of parole after 80 months, and a consecutive sentence enhancement for the use of a deadly weapon in the commission of the crime.
On appeal, Presfield argues this case should be remanded to the district court to allow him to withdraw his plea of guilty but mentally ill, enter a plea of not guilty, and proceed to trial.

DISCUSSION
Both appellants base their appeal on the premise that mental illness prevented them from understanding the consequences of the plea. Generally, we will not review a plea-validity challenge that is raised for the first time on appeal.[3] There are exceptions to this rule in cases where: (1) the error *490 clearly appears from the record;[4] or (2) the challenge rests on legal rather than factual allegations.[5] Here, the appellants challenge the validity of the pleas as being unknowing and involuntary because of a change in the law that raises a legal question that this court may resolve.
In Finger, we found the 1995 amended version of NRS 174.035(4), abolishing the defense of legal insanity, to be unconstitutional and unenforceable.[6] We held the portion of NRS 174.035(4) creating a plea of guilty but mentally ill unconstitutional and rejected the amended version of NRS 174.035(3) "in its entirety."[7] We further determined that "legal insanity is a well-established and fundamental principal of the law of the United States" protected by the Due Process Clauses of both the United States and Nevada Constitutions.[8] We then concluded that the pre-existing statutes that were amended or repealed by the 1995 statute should remain in full force and effect.[9]
Therefore, appellants should be allowed to enter pleas of not guilty by reason of insanity.

CONCLUSION
The statutory scheme under which appellants entered their pleas is unconstitutional and unenforceable. Therefore, both of the cases must be remanded to the district court and appellants be provided an opportunity to enter new pleas. On remand, the State will not be bound by any plea negotiations previously agreed to by the parties and the original charges in both cases may be reinstated.
We therefore order these appeals remanded for further proceedings in accordance with this decision.
MAUPIN, J., concurring.
I was among those who dissented to the conclusion in Finger v. State,[1] that the amended version of NRS 174.035(4) abolishing the defense of legal insanity was unconstitutional and unenforceable. Although my opinion on this issue remains unchanged, Finger compels the outcome reached by the majority.
NOTES
[1]  117 Nev. 548, 27 P.3d 66 (2001).
[2]  We elect to consolidate these appeals for disposition. See NRAP 3(b).
[3]  Bryant v. State, 102 Nev. 268, 272, 721 P.2d 364, 368 (1986) (the defendant is required to bring the challenge by filing a motion with the district court to withdraw the guilty plea or by initiating a post-conviction proceeding).
[4]  Smith v. State, 110 Nev. 1009, 1010 n. 1, 879 P.2d 60, 61 n. 1 (1994).
[5]  See Lyons v. State, 105 Nev. 317, 319, 775 P.2d 219, 220 (1989).
[6]  117 Nev. at 575, 27 P.3d at 84.
[7]  Id. at 576, 27 P.3d at 84.
[8]  Id. at 575, 27 P.3d at 84.
[9]  Id. at 576, 27 P.3d at 84.
[1]  117 Nev. 548, 27 P.3d 66 (2001).
