THE STATE OF SOUTH CAROLINA
In The Supreme Court
Ricky Dean Edwards, Petitioner,
State of South Carolina, Respondent.
ON WRIT OF CERTIORARI
Appeal From Horry County
John Milling, Trial Judge
Paula H. Thomas, Post-Conviction Relief Judge
Memorandum Opinion No. 2004-MO-072
Submitted November 29, 2004 – Filed December 20, 2004
REVERSED AND REMANDED
Assistant Appellate Defender Aileen P. Clare, S.C. Office of Appellate Defense, of Columbia, for Petitioner.
Attorney General Henry Dargan McMaster, Chief Deputy Attorney General John W. McIntosh, Assistant Deputy Attorney General Salley W. Elliott, Senior Assistant Deputy Attorney General Norman Mark Rapoport, all of Columbia, for Respondent.
PER CURIAM: Petitioner seeks a writ of certiorari from the denial of his application for post-conviction relief (PCR). The petition is denied on petitioner’s Question 2.
Because there is sufficient evidence to support the PCR judge’s finding that petitioner did not knowingly and intelligently waive his right to a direct appeal, we grant certiorari on petitioner’s Question 1 and proceed with a review of the direct appeal issue pursuant to Davis v. State, 288 S.C. 290, 342 S.E.2d 60 (1986).
Before the start of his trial, petitioner made a motion to quash the indictment. Petitioner argued the section of the first degree burglary statute that he was being charged under unconstitutionally denied him due process because it allowed his prior crimes to be introduced as elements of first degree burglary.  The trial judge denied the motion.
After the first day of trial, petitioner entered a plea of guilty but mentally ill. Trial counsel requested that the plea be accepted subject to petitioner’s right to appeal the constitutionality of the burglary statute; the State did not object. The trial judge accepted the plea and stated, “[T]he appeal will be taken, but he will not be prejudiced with respect to his right to contest the portion of the statute that provides that burglary in the first degree is based upon two prior convictions of burglary or housebreaking, two or more prior convictions.”
In this State, guilty pleas must be unconditional. State v. Peppers, 346 S.C. 502, 552 S.E.2d 288 (2001). If a defendant attempts to attach any condition to a guilty plea, then the trial court should direct a plea of not guilty. State v. O’Leary, 302 S.C. 17, 393 S.E.2d 186 (1990). It is impermissible for a defendant to preserve constitutional issues while entertaining a guilty plea. Id. If the trial court accepts a conditional guilty plea, then the plea will be vacated on appeal. Peppers, supra.
In our opinion, petitioner’s guilty plea was conditional and was, therefore, invalid. Trial counsel, the State, and the trial judge all acknowledged the conditional nature of petitioner’s guilty plea during the proceeding, yet the plea was still accepted. Accordingly, petitioner’s guilty plea is vacated and the case is remanded for a new trial.
REVERSED AND REMANDED.
TOAL, C.J., MOORE, WALLER, BURNETT and PLEICONES, JJ., concur.
 “A person is guilty of burglary in the first degree if the person enters a dwelling without consent and with intent to commit a crime in the dwelling, and . . . 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 . . . .” S.C. Code Ann. § 16-11-311 (A)(2) (2003).