
58 S.W.3d 134 (2001)
Ex parte Michael Keith BOYD, Applicant.
No. 74,121.
Court of Criminal Appeals of Texas.
October 24, 2001.
*135 Michael Keit Boyd, pro se.
Bill Hill, DA, Dallas, Matthew Paul, State's Atty., Austin, for Appellee.

OPINION
HOLCOMB, J., delivered the unanimous opinion of the Court.
We ordered applicant Michael Keith Boyd's post-conviction application for a writ of habeas corpus filed and set for submission to determine whether he was denied his federal constitutional right to due process of law. We hold that he was denied that right.

The Relevant Facts
On May 30, 1995, applicant committed the second degree felony offense of aggravated assault. On September 12, 1996, a Dallas County petit jury found him guilty of that offense. On that same date, the trial court made an affirmative finding that applicant intentionally selected his victim because of bias or prejudice against a group of which the victim was a member. See Tex.Code Crim. Proc. art. 42.014.[1] The trial court's affirmative finding had the effect of increasing the punishment range for applicant's offense from that of a second degree felony to that of a first degree felony. See Tex. Pen.Code § 12.47.[2] The jury then assessed applicant's punishment at imprisonment for life, a punishment within the punishment range for a first degree felony but not within the punishment range for a second degree felony. See Tex. Pen.Code §§ 12.32 & 12.33. On appeal, the Fifth Court of Appeals upheld applicant's conviction and sentence. Boyd v. State, No. 05-96-01516-CR, 1999 WL 161016 (Tex.App.-Dallas, March 25, 1999) (not designated for publication).
On December 8, 2000, applicant filed a pro se application for a writ of habeas corpus in the district court in which he was tried and convicted. That application has now been forwarded to this Court pursuant to Texas Code of Criminal Procedure article 11.07, § 3(d). In the application, applicant, citing Apprendi v. New Jersey, 530 U.S. 466, 120 S.Ct. 2348, 147 L.Ed.2d 435 (2000), argues for the first time that the trial court denied him his right to due process of law under the Fourteenth Amendment to the United States Constitution when the question of whether he selected his victim because of bias or prejudice was submitted to the court. With respect to the harm caused by the trial court's error, applicant points out that the affirmative finding "enabled the jury to give [him] a life sentence for his second-degree [felony] offense." Applicant requests that his sentence be vacated.


*136 Analysis

Before we address the merits of applicant's federal constitutional claim, we must first address whether that claim is cognizable via habeas corpus even though it is presented for the first time. Ordinarily, the writ of habeas corpus may not be used to litigate matters that could have been raised at trial and on direct appeal. Ex parte Bagley, 509 S.W.2d 332, 334 (Tex. Crim.App.1974). However, an applicant's failure to raise a claim at trial may be excused if the basis of the claim was not reasonably available at the time of trial. Ex parte Goodman, 816 S.W.2d 383, 385 n. 4 (Tex.Crim.App.1991). Because the Supreme Court's decision in Apprendi came almost four years after applicant's trial, we hold that his failure to assert an Apprendi-type claim at trial and on appeal does not bar him from asserting such a claim via habeas corpus.
We turn next to the merits of applicant's claim. In Apprendi, the Supreme Court considered the constitutionality of the New Jersey hate crimes statute. That statute allowed a jury to convict a defendant of a second degree offense based on its finding, beyond a reasonable doubt, that he unlawfully possessed a prohibited weapon; it then allowed, after a subsequent and separate proceeding, a trial judge to impose punishment for a first degree offense based upon the judge's finding, by a preponderance of the evidence, that the defendant's "purpose" for unlawfully possessing the weapon was "to intimidate" his victim on the basis of a particular characteristic the victim possessed. In holding the New Jersey statute violative of due process, the Supreme Court explained:
It is unconstitutional for a legislature to remove from the jury the assessment of facts [other than the fact of a prior conviction] that increase the prescribed range of penalties to which a criminal defendant is exposed. It is equally clear that such facts must be established by proof beyond a reasonable doubt.
Apprendi v. New Jersey, 530 U.S. at 490, 120 S.Ct. 2348.
Texas Code of Criminal Procedure article 42.014 and Texas Penal Code § 12.47, as applied at applicant's trial, removed from the jury the assessment of a fact that applicant chose his victim because of bias or prejudicethat increased the prescribed range of penalties to which applicant was exposed. Therefore, those statutes, as applied at applicant's trial, violated his right to due process. Moreover, the violation harmed applicant because it enabled the jury to assess his punishment beyond the prescribed statutory maximum for a second degree felony.
The prerequisites for habeas relief have been met. See Ex parte Fierro, 934 S.W.2d 370, 372 (Tex.Crim.App.1996), cert. denied, 521 U.S. 1122, 117 S.Ct. 2517, 138 L.Ed.2d 1019 (1997); Ex parte Banks, 769 S.W.2d 539, 540 (Tex.Crim.App.1989). The sentence in Cause No. F-96-02619-U in the 291st District Court of Dallas County is vacated, and applicant is remanded to the custody of the Sheriff of Dallas County so that a new punishment hearing may be held.
NOTES
[1]  At the time of applicant's offense and at the time of his trial, Article 42.014 provided:

In the punishment phase of the trial of an offense under the Penal Code, if the court determines that the defendant intentionally selected the victim primarily because of the defendant's bias or prejudice against a group, the court shall make an affirmative finding of that fact and enter the affirmative finding in the judgment of that case.
[2]  At the time of applicant's offense and at the time of his trial, § 12.47 provided:

If the court makes an affirmative finding under Article 42.014, Code of Criminal Procedure, in the punishment phase of the trial of an offense other than a first degree felony, the punishment for the offense is increased to the punishment prescribed for the next highest category of offense.
Section 12.47 has since been amended.
