
892 N.E.2d 1082 (2008)
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
William Dale CARTER, Defendant-Appellant.
Nos. 4-06-0920, 4-07-0134.
Appellate Court of Illinois, Fourth District.
June 6, 2008.
*1083 Justice STEIGMANN delivered the opinion of the court:
In August 2002, a jury convicted defendant, William Dale Carter, of home invasion (720 ILCS 5/12-11(a)(1) (West 2000)). The trial court later sentenced him to 20 years in prison. In September 2006, defendant pro se filed a petition for postconviction relief under the Post-Conviction Hearing Act (725 ILCS 5/122-1 through 122-8 (West 2006)). In October 2006, the court dismissed his petition. Defendant now appeals (case No. 4-06-0920).
In December 2006, defendant filed a petition for relief from judgment pursuant to section 2-1401 of the Code of Civil Procedure (735 ILCS 5/2-1401 (West 2006)). In January 2007, the trial court granted the State's motion to strike his petition. Defendant now appeals (case No. 4-07-0134).
At defendant's request, we have consolidated these appeals. For the reasons that follow, we (1) reverse the trial court's dismissal of defendant's postconviction petition and remand with directions (case No. 4-06-0920) and (2) affirm the trial court's dismissal of defendant's section 2-1401 petition (case No. 4-07-0134).

I. BACKGROUND
Following defendant's home-invasion conviction and 20-year prison sentence, he appealed to this court. In People v. Carter, 362 Ill.App.3d 1180, 1195, 299 Ill.Dec. 320, 841 N.E.2d 1052, 1064 (2005), we affirmed.
In September 2006, defendant pro se filed a postconviction petition contending, in part, that his (1) trial counsel was ineffective for not requesting that the jury be instructed on the lesser included offense of criminal trespass to a residence (720 ILCS 5/19-4 (West 2000)) and (2) appellate counsel was ineffective for failing to raise that and other issues on direct appeal.
In October 2006, the trial court entered the following written order:
"Cause comes on for the [c]ourt's review of the [d]efendant's current [p]etition for [p]ostconviction [r]elief. The [c]ourt having reviewed the record of this case and having reviewed the defendant's current [p]etition for [p]ostconviction [r]elief, [finds]:
1. The defendant appealed his conviction to the Illinois Appellate Court and that appeal was denied.
2. The defendant filed one or more [p]ostconviction petitions which were denied by the trial court, appealed to the Illinois Appellate Court, and also denied.
3. The defendant again filed a subsequent [p]ostconviction [p]etition alleging the same or similar errors or alleges errors that could have been addressed in his earlier [p]ostconviction [p]etitions.

*1084 It is ordered that the [d]efendant's present [p]ostconviction petition filed September 14, 2006[,] is denied as duplicitous or dismissal [sic] on the basis of res judicata and waiver."
Defendant now appeals (case No. 4-06-0920).
In December 2006, defendant filed his petition for relief from judgment pursuant to section 2-1401 (735 ILCS 5/2-1401 (West 2006)). In January 2007, the trial court granted the State's motion to strike his petition for relief from judgment. Defendant appeals (case No. 4-07-0134). As earlier noted, we granted defendant's request to consolidate case Nos. 4-06-0920 and 4-07-0134.

II. ANALYSIS

A. Case No. 4-06-0920
Defendant argues that the trial court erred by dismissing his pro se postconviction petition. Specifically, he contends that the court erred by deeming his September 2006 postconviction petition to be an improper subsequent petition because he had not previously filed a postconviction petition. We agree.

1. Proceedings Under the Act

A defendant may proceed under the Act by alleging that "in the proceedings which resulted in his or her conviction there was a substantial denial of his or her rights under the Constitution of the United States or of the State of Illinois or both" (725 ILCS 5/122-1(a)(1) (West 2006)). In noncapital cases, the Act establishes a three-stage process for adjudicating a postconviction petition. 725 ILCS 5/122-1 through 122-8 (West 2006); People v. Jones, 213 Ill.2d 498, 503, 290 Ill. Dec. 519, 821 N.E.2d 1093, 1096 (2004). At the first stage, the "trial court, without input from the State, examines the petition only to determine if [it alleges] a constitutional deprivation unrebutted by the record, rendering the petition neither frivolous nor patently without merit." (Emphasis in original.) People v. Phyfiher, 361 Ill.App.3d 881, 883, 297 Ill.Dec. 694, 838 N.E.2d 181, 184 (2005). "Section 122-2.1 [of the Act] directs that if the defendant is sentenced to imprisonment (rather than death) and the circuit court determines that the petition is frivolous or patently without merit, it shall be dismissed in a written order. 725 ILCS 5/122-2.1(a)(2) (West 2004)." People v. Torres, 228 Ill.2d 382, 394, 320 Ill.Dec. 874, 888 N.E.2d 91, 99-100 (2008).
If a petition is not dismissed at stage one, it proceeds to stage two, where section 122-4 of the Act provides for the appointment of counsel for an indigent defendant who wishes counsel to be appointed (725 ILCS 5/122-4 (West 2006)). At the second stage, the State has the opportunity to answer or move to dismiss the petition (725 ILCS 5/122-5 (West 2006)), and the trial court determines whether the petition alleges a "substantial showing of a constitutional violation" (Phyfiher, 361 Ill. App.3d at 883, 297 Ill.Dec. 694, 838 N.E.2d at 184). "A defendant is not entitled to an evidentiary hearing * * * as a matter of right" (People v. Makiel, 358 Ill.App.3d 102, 105, 294 Ill.Dec. 319, 830 N.E.2d 731, 736 (2005)), and "nonspecific and nonfactual assertions are insufficient to require an evidentiary hearing" (People v. Broughton, 344 Ill.App.3d 232, 236, 279 Ill.Dec. 149, 799 N.E.2d 952, 956 (2003)). If the allegations of the petition, supported by the record and accompanying affidavits, demonstrate a substantial violation of a constitutional right, the petition proceeds to stage three for an evidentiary hearing. Phyfiher, 361 Ill.App.3d at 884, 297 Ill.Dec. 694, 838 N.E.2d at 184.


*1085 2. The Trial Court's Improper Stage One Dismissal

As noted earlier, the trial court dismissed defendant's September 2006 postconviction petition because the court deemed it an improper subsequent petition. However, as the State concedes, this designation was not correct. Although defendant had appealed his conviction, he had not previously filed a postconviction petition.
The trial court's confusion may be due to defendant's August 2006 "motion for declaratory judgment," in which he sought to attack his September 2001 guilty plea to a violation of an order of protection, for which he was sentenced to 12 months' probation. The September 2001 case involved the same victim as the present case, Patricia Bizaillion. In August 2007, the court denied defendant's motion, and the matter is currently before this court on appeal (case No. 4-07-0781).
If, as here, defendant's postconviction petition is not a subsequent petition, then the trial court may dismiss it under section 122-2.1 of the Act only if the court determines that it is frivolous or patently without merit. Although the trial court in this case dismissed the petition, it made no such determination.
The State contends that because this court may affirm the trial court's judgment on any basis supported by the record, we can examine the record ourselves to determine whether defendant's postconviction petition was frivolous or patently without merit. We decline the State's invitation to do so. The Act's legislative scheme provides for a trial court initially to (1) make that determination and, if it does not so decide, (2) then proceed to the second stage of postconviction proceedings.
Accordingly, we reverse the trial court's dismissal of defendant's September 2006 postconviction petition and remand for stage-two proceedings in accordance with the views expressed herein. This decision does not constitute any statement by this court regarding what merits, if any, that petition may possess.

B. Case No. 4-07-0134
In this consolidated appeal, defendant has not argued for reversal of the trial court's dismissal of his section 2-1401 petition. Because that motion and his postconviction petition (the dismissal of which we have now reversed) are so similar, the defendant is apparently seeking only a reversal and a remand on the postconviction petition. Accordingly, we affirm the trial court's dismissal of defendant's section 2-1401 petition.

III. CONCLUSION
For the reasons stated, in case No. 4-06-0920, we reverse the trial court's dismissal of defendant's postconviction petition and remand with directions. In case No. 4-07-0134, we affirm the trial court's judgment.
No. 4-06-0920, Reversed and remanded with directions.
No. 4-07-0134, Affirmed.
APPLETON, P.J., and TURNER, J., concur.
