
602 So.2d 1192 (1991)
Ex parte Bobby Wayne MADDEN.
(Re Bobby Wayne Madden
v.
State).
1900313.
Supreme Court of Alabama.
August 23, 1991.
Mac Downs, Gadsden, for petitioner.
James H. Evans, Atty. Gen., and P. David Bjurberg, Asst. Atty. Gen., for respondent.
KENNEDY, Justice.
Bobby Wayne Madden pleaded guilty to, and was convicted of, one count of burglary, one count of rape, and two counts of sodomy, all in the first degree. At the sentencing hearing, the State presented evidence of three prior felony convictions in Georgia. Madden was sentenced under the Habitual Felony Offender Act, Ala.Code 1975, § 13A-5-9, to life imprisonment without the possibility of parole.
Madden appealed from his sentence to the Court of Criminal Appeals. He argued that he had been improperly sentenced under the Habitual Felony Offender Act. Specifically, he argued that the trial court had erroneously enhanced his sentence for having three prior felony convictions where two of the convictions were for sodomy, one anal and the other oral, and arose from the same transaction; he argues that those two prior convictions should have been considered as one felony conviction for purposes of enhancement in Alabama. The Court of Criminal Appeals, in an unpublished memorandum opinion, 575 So.2d 1256 (Ala.Crim.App.1990), held that the issue was not properly before that court because, the court wrote, Madden should have attacked the validity of the prior convictions by petitioning for post-conviction relief in Georgia. See Johnson v. State, 541 So.2d 1112, 1115 (Ala.Crim.App. 1989).
Madden argues here that the Court of Criminal Appeals' decision conflicts with this Court's decision in Ex parte Lockett, 548 So.2d 1045 (Ala.1989). In that case, the defendant was convicted of manslaughter and was sentenced to 99 years' imprisonment. The Court of Criminal Appeals affirmed the conviction and the sentence, without opinion. Subsequently, the defendant instituted a proceeding for post-conviction relief in the court of conviction. The trial court denied the petition, and the Court of Criminal Appeals affirmed, again without opinion. In his petition to this Court, the defendant in that case averred that, at the sentencing phase of his trial, the State had failed to give him notice of its intention to proceed under the Habitual Felony Offender Act. This Court cited Rule 20.2(a)(5), A.R.Crim.P.Temp. (now Rule 32.2(a)(5), A.R.Crim.P), which states:

*1193 "(a) Preclusion of Grounds. A petitioner will not be given relief under this rule based upon any ground:
"....
"(5) Which could have been but was not raised on appeal, unless the ground for relief arises under Rule 20.1(b)."
This Court held in Lockett that a claim of improper enhancement of a defendant's sentence under the Habitual Felony Offender Act is properly presented in a direct appeal to that court. We further held that, pursuant to Rule 20.2(a)(5), the defendant's failure to raise that issue on appeal could not be remedied in a Rule 20, A.R.Crim. P.Temp., proceeding.
Madden argues that the Court of Criminal Appeals erroneously based its affirmance of his sentence on Johnson v. State, supra. In Johnson, a defendant complained of the State's failure to disclose to him, after giving notice of its intention to prosecute under the Habitual Felony Offender Act, that his prior felony convictions had occurred when he was a juvenile. The Court of Criminal Appeals, rejecting the defendant's argument, held that the proper forum for attacking the validity of prior convictions used for enhancing punishment in Habitual Felony Offender Act proceedings would be in the court of conviction by post-conviction petition.
In this case, the Court of Criminal Appeals based its decision that it could not review on direct appeal the validity of prior felony convictions used for purposes of enhancement on its decision in Johnson. While Johnson contains an accurate statement of the law, it is not applicable to the facts of this case. Madden does not argue that his prior felony convictions in Georgia are invalid, but that, for purposes of enhancement under the Habitual Felony Offender Act, the two prior sodomy convictions should be considered as one felony conviction under Alabama law. Thus, we hold, based on Ex parte Lockett, that the Court of Criminal Appeals is not precluded from reviewing on direct appeal the question whether the two prior sodomy convictions, which arose from a single transaction, should be considered as one felony conviction for purposes of enhancement of Madden's sentence under the Habitual Felony Offender Act.
Accordingly, the judgment of the Court of Criminal Appeals is reversed and the cause is remanded to that court for a review consistent with this opinion.
REVERSED AND REMANDED.
HORNSBY, C.J., and MADDOX, ALMON, SHORES, ADAMS, HOUSTON and INGRAM, JJ., concur.
