
148 P.3d 990 (2006)
2006 UT 76
STATE of Utah, Plaintiff and Appellant,
v.
Craig NICHOLLS, Defendant and Appellee.
No. 20050176.
Supreme Court of Utah.
December 5, 2006.
*991 Mark L. Shurtleff, Atty Gen., Joanne C. Slotnik, Asst. Att'y Gen., Salt Lake City, for plaintiff.
Herm Olsen, Logan, for defendant.
DURHAM, Chief Justice:
¶ 1 This case comes before us on appeal from the district court's denial of a motion to correct an illegal sentence. We affirm.

PROCEDURAL BACKGROUND
¶ 2 On November 10, 2003, Craig Nicholls, (Defendant) pled guilty to and was simultaneously sentenced for the crime of aggravated murder. On December 1, 2003, Defendant, acting pro se, filed a letter and document with the district court which the court treated as a motion to withdraw a guilty plea. The court dismissed the motion stating that it had no jurisdiction pursuant to Utah Code section 77-13-6 and directed Defendant to pursue his claim under the Post-Conviction Remedies Act and rule 65C of the Utah Rules of Civil Procedure. Then, on November 15, 2004, Defendant, once again acting pro se, filed a Motion to Correct an Illegal Sentence and Arrest Judgment. The motion was denied for lack of subject matter jurisdiction. Defendant appealed, and counsel was appointed for purposes of this appeal. We have jurisdiction pursuant to Utah Code section 78-2-2(3)(i) (2002).

ANALYSIS
¶ 3 The district court denied Defendant's motion for lack of subject matter jurisdiction. This presents a question of law, which we review for correctness, granting no deference to the district court. Beaver County v. Qwest, Inc., 2001 UT 81, ¶ 8, 31 P.3d 1147.
¶ 4 This action was filed in the guise of a motion to correct an illegal sentence under rule 22(e) of the Utah Rules of Criminal Procedure. However, the substance of the relief sought is the withdrawal of Defendant's guilty plea due to lack of a knowing and voluntary waiver of rights.
¶ 5 Rule 22(e) of the Utah Rules of Criminal Procedure states that "The court may correct an illegal sentence, or a sentence imposed in an illegal manner, at any time." However, this court has held that "an appellate court may not review the legality of a sentence under rule 22(e) when the substance of the appeal is . . . a challenge, not to the sentence itself, but to the underlying conviction." State v. Brooks, 908 P.2d 856, 859 (Utah 1995); see also State v. Telford, 2002 UT 51, ¶ 7, 48 P.3d 228; State v. Finlayson, 2000 UT 10, ¶ 8, 994 P.2d 1243. Similarly, review is barred when the "conviction" being challenged is in the form of a guilty plea and the defendant attempts to withdraw that plea using a rule 22(e) challenge. State v. Reyes, 2002 UT 13, ¶ 3, 40 P.3d 630. In this case, the substance of Defendant's appeal is a challenge to his guilty plea based on his alleged "seriously impaired mental state" at the time of the plea. He does not make any other challenge concerning his sentence. Thus, rule 22(e) is an improper avenue of relief for Defendant's claims.
¶ 6 Furthermore, under Utah Code section 77-13-6(2)(b) (Supp.2006), "[a] request to withdraw a plea of guilty . . . shall be made by motion before sentence is announced." In Defendant's case, he was sentenced immediately after he entered his guilty plea and waived the statutory time period during which he could have withdrawn his plea. Thus, Defendant's challenge to his guilty plea, having been made outside the time period specified by statute, can only "be pursued under Title 78, Chapter 35a, Post-Conviction Remedies Act, and rule 65C, Utah Rules of Civil Procedure." Utah Code Ann. § 77-13-6(2)(c); see State v. Merrill, 2005 UT 34, ¶¶ 1, 6-7, 13-20, 114 P.3d 585; Reyes, 2002 UT 13, ¶ 3, 40 P.3d 630.
¶ 7 The Post-Conviction Remedies Act is thus the proper, and only, avenue for relief now available to Defendant. We note that Defendant may be entitled to counsel pursuant to Utah Code section 78-35a-109.


*992 CONCLUSION
¶ 8 We affirm the district court's denial of Defendant's motion. Defendant must pursue his claims under the Post-Conviction Remedies Act and rule 65C of the Utah Rules of Civil Procedure.
¶ 9 Associate Chief Justice WILKINS, Justice DURRANT, Justice PARRISH, and Justice NEHRING concur in Chief Justice DURHAM's opinion.
