OPINION
Opinion by
Justice MOSELEY.Charged with capital murder in a case wherein the State had waived the death penalty, Clark DeWayne Mays pled guilty and was sentenced to life imprisonment. Mays appeals the conviction.
On voir dire, Mays made the statement that, “The law in Texas is that we can look at their history, their medical history, their psychological history, their psychiatric history, and we can look at those factors to determine their state of mind.” At this point, the State interrupted with a request for a bench conference, after which the jury was removed and an on-record discussion regarding the admissibility of such evidence ensued.
The trial court commenced this discussion with the acknowledgment that it had been provided with a copy of Jackson v. State, 160 S.W.3d 568 (Tex.Crim.App.2005), had read it, and was prepared to rule on the admissibility of evidence regarding Mays’ mental capabilities, inviting Mays to make a record for appeal of that specific issue. Throughout, both the trial court and Mays use the term “diminished capacity” in the exchange and in the proffer for the record.
Based upon language found in different parts of Jackson, Mays conceded that, while Texas law does not recognize an affirmative defense “[t]o show that the defendant was not able at the time to understand the nature of his actions as a result of mental impairments,” nevertheless “mental illness is relevant and it is admissible as evidence to show that the defendant lacked the capacity ... to form the specific intent or the intent element of murder.” Mays went on to state that it had been his intention and his trial strategy to question the jury panel on the members’ reactions to such a position and attempt to determine how they would view evidence of “mens rea of intent versus how it would apply to the lesser included offense of negligent homicide” and the “included offense of manslaughter and how the defendant’s state of mind and mental impairments as related to that state of mind would have related to the lesser included offense of manslaughter.”
The trial court responded that evidence of this nature would
be applicable in a case where punishment was at issue. But the punishment is not at issue in this case. The only thing it could be applied to in this case would be the question of guilt or innocence. Guilt or innocence cannot be defended by a diminished capacity defense in this case.... That is the court’s ruling and that is the way we will proceed.1
*653During this hearing concerning exclusion of matters regarding this issue, the trial court went on to add that, “The ruling of this court is that if you had a punishment issue, that that evidence might very well be admissible.” There was no attempt by the trial court to weigh the impact of such testimony on other considerations which the court is permitted to take into account in applying Rule 408 of the Texas Rules of Evidence. See Tex.R. Evid. 403.
In light of the ruling and being unable to proceed toward seeking a charge on a lesser included offense, Mays entered his guilty plea.
The issue here hinges directly upon the interpretation to be placed upon the statements contained in Jackson, 160 S.W.3d 568, and its application at trial. It is quite apparent from the exchange between Mays and the trial court that it was contemplated by all that this very issue would be appealed in order to obtain a ruling which set out the framework by which trial courts were to operate in light of the positions set out in Jackson.2
In many cases, a court can be presented with countervailing considerations in a murder trial. On the one hand, Article 38.36(a) of the Texas Code of Criminal Procedure states that:
In all prosecutions for murder, the state or the defendant shall be permitted to offer testimony as to all relevant facts and circumstances surrounding the killing and the previous relationship existing between the accused and the deceased, together with all relevant facts and circumstances going to show the condition of the mind of the accused at the time of the offense.
Tex.Code Ceim. PROC. Ann. art. 38.36(a) (Vernon 2005) (emphasis added).
However, this blanket permission is tempered by Rule 403 of the Texas Rules of Evidence, which permits the court to exercise its discretion by weighing the admission of evidence against other factors, such as unfair prejudice, confusion of the issues, misleading the jury, or by considerations of undue delay or needless presentation of cumulative evidence, even if the evidence is otherwise relevant.
In this case, the sole issue is whether the defense may present evidence at the guilt/innocence phase of the trial to show that the defendant is afflicted with mental or physical impairments or abnormalities which bring into question whether he possessed the required state of mind at the time of the offense; in other words, whether a defendant’s state of mind is such that it decreases his ability to formulate or possess the intent to commit a crime of the nature with which he is charged.
We review a trial court’s ruling to admit or exclude evidence under an abuse of discretion standard. Green v. State, 934 S.W.2d 92, 101-02 (Tex.Crim. *654App.1996); Montgomery v. State, 810 S.W.2d 372, 391 (Tex.Crim.App.1990) (op. on reh’g). If the court’s decision falls outside the “zone of reasonable disagreement,” it has abused its discretion. Montgomery, 810 S.W.2d at 391. As long as the trial court’s ruling falls within the zone of reasonable disagreement, we will affirm its decision. Moses v. State, 105 S.W.3d 622, 627 (Tex.Crim.App.2003). The trial court’s decision must be reasonable in view of all the relevant facts. Santellan v. State, 939 S.W.2d 155, 169 (Tex.Crim.App.1997).
Jackson makes it clear that, “Texas does not recognize diminished capacity as an affirmative defense i.e., a lesser form of the defense of insanity.” Jackson, 160 S.W.3d at 573. It does, however, recognize something very closely akin to it, that being based on a diminished-capacity doctrine, this being “simply a failure-of-proof defense in which the defendant claims that the State failed to prove that the defendant had the required state of mind at the time of the offense.” Id.
Due to the instruction by the court during voir dire that Mays was not to pursue the issue of his mental deficiencies, and the court’s blanket refusal (as a matter of law) to admit any evidence of this type, whatever its actual content, there was no showing of the nature of the evidence which was to be produced or the conclusions concerning the mens rea required of a capital murder case. Therefore, we are not given the opportunity to compare the facts here with the ruling in Jackson.3
However, in Mays’ presentation of the evidence which he indicated that he was attempting to put forward, he states that his object was to show that he would have explored relevant facts and circumstances going to show the condition of his mind at the time of the killing and to apply it to the lesser included offense of negligent homicide.
We believe that this is a permissible aim of following the diminished-capacity doctrine set forth in Jackson; in other words, so long as the defense is not pursuing a course of attempting to prove that the defendant has absolutely no culpability for his actions but is, rather, making an effort to show that the defendant’s mental state reduced his mens rea to a state that the question of a lesser included offense can become an issue, that is a permissible avenue to pursue.
The Texas Court of Criminal Appeals states in Jackson that
the trial judge has discretion to determine whether evidence of mental illness may be presented to negate the element of mens rea, or whether the evidence should be excluded on special grounds. If such evidence is admitted, the trial judge additionally has the discretion to determine whether the evidence supports a lesser-included-offense instruction.
Jackson, 160 S.W.3d at 574.
Obviously, if there is discretion in the trial court to deny the entry of relevant evidence of this nature, that discretion must have some basis. That basis is found in the considerations to take into account as set out in Rule 403. Tex.R. Evid. 403. When Jackson speaks of whether lesser included offense instructions are to be submitted to a jury, this kind of question must, by its nature, arise during the guilt/innocence phase of a trial. By the time the punishment phase of a *655trial is entered, it is then too late for a jury to go back and determine whether the defendant should not have been convicted of the crime for which he was charged but, rather, for a lesser crime. Therefore, if a defendant has the ability to pursue a failure-to-prove defense based upon a defendant’s mental defect, deficiency, or abnormality, that evidence must be allowed to be introduced at the guilt/innocence phase of the trial; such evidence is not restricted to the punishment phase.
By deciding the admissibility of the evidence based solely and explicitly on an incorrect application of law, the trial court necessarily abused its discretion. “As to the determination of controlling legal principles, an abuse of discretion occurs if the trial court clearly fails to analyze or apply the law correctly. A trial court has no discretion in determining what the law is or applying the law to the facts. Thus, a failure by a trial court to analyze or apply the law correctly will constitute an abuse of discretion.” State v. Kurtz, 152 S.W.3d 72, 81 (Tex.Crim.App.2004) (Holcomb, J., dissenting) (footnotes omitted). “A trial court has no ‘discretion’ in determining what the law is or applying the law to the facts.” Huie v. DeShazo, 922 S.W.2d 920, 927-28 (Tex.1996). “Misapplication of the law to the facts of a particular case is a per se abuse of discretion.” State v. Ballard, 987 S.W.2d 889, 893 (Tex.Crim.App.1999). Consequently, the trial court’s erroneous legal conclusion is an abuse of discretion. Kurtz, 152 S.W.3d at 81; Huie, 922 S.W.2d at 927-28.
We find that the trial court was in error in having excluded en tato the entire realm of the matter of Mays’ mental deficiencies as they relate to his ability to form the necessary mens rea to commit capital murder.
Mays withdrew his not guilty plea following (and explicitly based upon) the trial court’s ruling which barred his effort to present evidence and argument concerning the impact which Mays’ mental status had upon his ability to form the necessary mens rea to commit the offense with which he was charged; he obtained permission to appeal that ruling. As a consequence, no evidence was presented from which we can determine whether the trial court’s erroneous ruling substantially affected Mays’ substantial rights. This ruling precipitated Mays’ guilty plea. Thus, it necessarily contributed to his conviction. See Tex. R.App. P. 44.2(b); Hale v. State, 139 S.W.3d 418, 420 (Tex.App.-Fort Worth 2004, no pet.).
Accordingly, we sustain Mays’ contention of error.
We reverse the judgment and remand the case to the trial court for further proceedings consistent with this opinion.
. At one point, the trial court did say that, "Furthermore, even if relevant, the court finds that the admission of such evidence would cause prejudice, would be irrelevant, and would be confusing to the jury.” However, this was not the court’s final ruling on the matter. Later during the discussion, the State inquired about whether there would be *653a proffer of the expert testimony which Mays had intended to present. Mays’ counsel addressed the court, saying, "No, he indicated that he would not — as I heard you, judge, not fall back on the probative prejudice argument, and it was a blanket ruling that such evidence was inadmissable [sic]. That’s how I understood you to say it.” The court responded, "That's the way I meant it.” Therefore, it is quite clear from the entirety of the court’s remarks that it was not relying on those findings but, rather, strictly on its ruling that this kind of evidence was not admissible at the guilt/innocence phase for any reason unless it was under a straight insanity plea.
. The trial court said,
I will be glad to certify your appeal on the entire point, but bar out any evidence of mental incapacity short of insanity, because it’s my opinion in this particular case, a capital case with the death penalty waived, that the only defense would be insanity and not any kind of diminished mental capacity.
. In Jackson, the evidence showed that Jackson did, indeed, intend to cause serious bodily harm or injury to his brother, the victim. Accordingly, the court determined that he possessed the requisite mens rea, undiminished by his mental deficiencies.