
543 So.2d 716 (1988)
Ex parte Truman HARMON.
(Re Truman Harmon v. State of Alabama).
86-1209.
Supreme Court of Alabama.
February 12, 1988.
Rehearing Denied September 23, 1988.
Charles Ned Wright, Wedowee, for petitioner.
Don Siegelman, Atty. Gen., and Beth Slate Poe, Asst. Atty. Gen., for respondent.
ADAMS, Justice.
The defendant, Truman Harmon, pursuant to his guilty plea, was convicted of escape in the second degree, burglary in the third degree, and theft of property in the second degree. He filed a petition for writ of error coram nobis contesting the validity of his convictions. After a hearing, the trial court denied the writ, and he appealed that denial to the Court of Criminal Appeals. Harmon argued to the Court of Criminal Appeals that he should not have received separate sentences for the third degree burglary and the second degree theft on a joint indictment. However, the Court of Criminal Appeals affirmed, holding that this precise issue had not been *717 presented to the trial court and therefore had not been preserved for appeal, 543 So.2d 715 (Ala.Cr.App.1987). Harmon now argues to this Court that he did raise this issue in the trial court; we agree, and we reverse and remand.
In his petition for writ of error coram nobis, Harmon raised the argument that he should not have gone "to court on an indictment with two completely different charges on one (1) indictment." His petition states: "Burglury [sic] in the third degree is a complete charge. Theft of property in the second degree is a complete charge." In his hearing, the following occurred:
THE COURT: As I understand it, the basis of the writpetition or writ of error coram nobisis the burglary in the third degree and theft of property in the second degree cases which are contained in an indictment CC 83-037 and that the two felony offenses should not have been joined or what'sI'm not sure if I do understand what we're talking about.
MR. WRIGHT: That's what Mr. Harmon states in his petition, Judge, that they should not have been joined.
THE COURT: That the burglary charge and theft of property charge, while they might arguably have been properly jointly indicted, he could only enter a plea to one of those charges I suppose. Mr. Harmon, is that what you're saying?

MR. HARMON: Yes.

(Emphasis added).
In its order denying Harmon's writ, the trial court stated:
Petitioner argued that joinder was improper and that even if joinder were proper he could not be found guilty of both charges. The court finds both arguments without merit.
(Emphasis added).
Harmon, with the advice of counsel, pleaded guilty to both charges and received separate consecutive sentences for each conviction. Harmon, writing pro se in his petition for the writ, specifically raised the question whether it was error to try him on both charges. The State argues that Harmon really was objecting to the joinder of the charges and his plea to both of the charges, not to his sentences. However, it logically follows that, because Harmon entered a plea of guilty to both charges and as a result received two sentences, the gist of his petition is an attack on the convictions and sentences he received.
Furthermore, it is clear from the record of the hearing and from the trial court's order that the trial court was aware of Harmon's contention that he could only enter a guilty plea either to burglary in the third degree or to theft of property in the second degree, not to both. Therefore, the trial court, in denying Harmon's writ, ruled on this issue. See Ex parte O'Leary, 417 So.2d 232 (Ala.1982), cert. denied, O'Leary v. Alabama, 463 U.S. 1206, 103 S.Ct. 3536, 77 L.Ed.2d 1387 (1983) (the issue must be preserved at the lower court level before it can be reviewed on appeal).
We reverse the judgment of the Court of Criminal Appeals, because we find that the issue of Harmon's consecutive sentences was properly preserved for appeal; therefore, we remand this case to the Court of Criminal Appeals for it to determine whether Harmon was in fact subject to the imposition of separate sentences.
REVERSED AND REMANDED.
TORBERT, C.J., and MADDOX, JONES, ALMON, SHORES, BEATTY, HOUSTON and STEAGALL, JJ., concur.
