The appellant, William C. Hammond, was convicted of rape in the first degree, see § 13A-6-61, Ala.Code 1975; rape in the second degree, see § 13A-6-62, Ala. Code 1975; sodomy in the second degree, see § 13A-6-64; sexual abuse in the first degree, see § 13A-6-66, Ala.Code 1975; and sexual abuse in the second degree, see § 13A-6-67, Ala.Code 1975. The circuit court sentenced Hammond to 40 years’ imprisonment on the first-degree rape conviction, 20 years’ imprisonment on the second-degree rape conviction, 20 years’ imprisonment on the second-degree sodomy conviction, 10 years’ imprisonment on the first-degree sexual-abuse conviction, and 1 year’s imprisonment for the second-degree sexual-abuse conviction. The circuit court ordered that the sentences were to run concurrently. The court further ordered Hammond to pay $10,000 to the Crime Victims Compensation Fund and $680 in restitution. This appeal followed.
Hammond raises three issues on appeal: (1) whether the circuit court erred in allowing the State to open the door on cross-examination to rebuttal evidence regarding Hammond’s character when Hammond did not place his character at issue during direct examination; (2) whether the circuit court erred in not granting Hammond’s motion for a new trial based on newly discovered evidence when the evidence was reliable evidence that met each of the prongs of the requisite test; and (3) whether the circuit court erred in not allowing him to offer into evidence records prepared by the Department of Human Resources when the records were proper business records not made in anticipation of litigation and when the records went to the victim’s credibility. Hammond does not challenge the sufficiency of the evidence on appeal. Therefore, a detailed recitation of the facts is unnecessary in this case.
The dispositive issue raised by Hammond on appeal is whether the circuit *420court erred when it allowed the State to open the door for rebuttal evidence during its cross-examination of Hammond. At trial, after resting its case, the State asked the following of Hammond on cross-examination: “All right. You have told the jury that the things that K.G. has talked about, that you just didn’t do these things; is that right? ... You wouldn’t do that kind of thing, would you?” (R. 406.) During a bench conference, Hammond objected to this line of questioning based on the grounds that the question concerned irrelevant matters and because the question “opened a wide door” to the admission of allegedly other improper matters. The State advised the circuit court that new evidence had come to light since it had rested its case; namely, that a cousin of Hammond’s had come forward with her own accusation that Hammond had raped her when she was 18 years old. The State argued that it had a broad right to cross-examine and rebut anything stated by Hammond on the witness stand and that this broad right allowed the State to present this evidence without reopening its case-in-chief. Hammond argued that the State could not create its own rebuttal and that if the State wanted to present new evidence, rebuttal was not the proper time to do so.
The circuit court overruled Hammond’s objection. The circuit court’s ruling resulted in the following exchange during the State’s cross-examination of Hammond:
“[The State]: Before the break, Mr. Hammond, you were telling the jury how you didn’t do any of these things that K.G. had alleged that you did; is that correct?
“[Hammond]: Yes, ma’am.
“[The State]: Isn’t it true that not only did you rape K.G. when she was fifteen years old, but you also raped your cousin, [K.X.], when she was thirteen years of age back when you were home visiting from the boot camp?
“[Hammond]: No, ma’am.
“[The State]: Never happened?
“[Hammond]: Huh-uh (indicating no).”
(R. 439.) After Hammond’s testimony, the defense rested its case. The State then called Hammond’s cousin, K.X., as a rebuttal witness. At this point, Hammond renewed his objection, stating that “any rebuttal at this point in time, either this witness or anybody else ... the State opened the door; we didn’t open the door.” (R. 459-60.) The circuit court overruled the objection, and K.X. testified that Hammond had forced her to engage in sexual intercourse with him when she was 13 years old. The jury subsequently convicted Hammond of the aforementioned crimes.
The admission or exclusion of evidence is a matter within the sound discretion of the trial court. Taylor v. State, 808 So.2d 1148, 1191 (Ala.Crim.App.2000), aff'd, 808 So.2d 1215 (Ala.2001). “The question of admissibility of evidence is generally left to the discretion of the trial court, and the trial court’s determination on that question will not be reversed except upon a clear showing of abuse of discretion.” Ex Parte Loggins, 771 So.2d 1093, 1103 (Ala.2000). This is equally true with regard to the admission of collateral-acts evidence used for rebuttal. See Davis v. State, 740 So.2d 1115, 1130 (Ala.Crim.App.1998).
The Alabama Supreme Court recently addressed the issue of the State’s creating its own rebuttal through questions on cross-examination in Ex parte Ray, 52 So.3d 555 (Ala.2009). In Ex parte Ray, the defendant was charged with first-degree sexual abuse arising out of an offense involving a child. Before the trial began, Ray filed a motion in limine to prevent the prosecution from referring to a juvenile *421adjudication that had resulted in Ray’s undergoing sex-offender treatment after he had made sexual contact with his eight-year-old niece; the circuit court granted this motion. 52 So.3d at 557. During the trial, Ray testified on his own behalf, and the prosecution asked Ray if he “just wouldn’t do something like that,” referring to having sexual contact with children. Ray responded, “No. No.” Ray, 52 So.3d at 557. The circuit court found that by saying “no” to the prosecutor’s question, Ray had opened the door to rebuttal evidence, despite its earlier ruling on Ray’s motion in limine. Ray, 52 So.3d at 557-58.
The State then questioned Ray about his prior juvenile sexual convictions and during rebuttal elicited testimony from an investigating detective regarding conversations the detective had had with Ray regarding Ray’s sexual contact with his niece and Ray’s sex-offender treatment. 52 So.3d at 558. The jury subsequently convicted Ray of first-degree sexual abuse. This Court affirmed Ray’s conviction and sentence on appeal. See Ray v. State, 52 So.3d 547 (Ala.Crim.App.2007). Ray then petitioned the Alabama Supreme Court for a writ of certiorari.
The Alabama Supreme Court granted Ray’s petition and reversed this Court’s judgment, holding that Ray had not opened the door to the State’s evidence. The Supreme Court noted that “the State fails to explain how Ray’s answers could constitute ‘opening the door’ when they were direct responses to questions asked by the prosecutor on cross-examination.” Ex parte Ray, 52 So.3d at 561. The Court determined that a defendant does not put his character at issue “merely by responding to the prosecutor’s cross-examination designed to elicit testimony on that subject.” Ex parte Ray, 52 So.3d at 560-62. The Court adopted language from an earlier decision, Ex parte Woodall, 730 So.2d 652 (Ala.1998), in which that Court stated:
“ ‘ “[T]he defendant did not voluntarily place his character in issue. He merely responded to questions which placed his character in issue.... This line of cross-examination was obviously an endeavor to compel defendant to respond to questions which placed his character in issue and which insured an excuse for the State’s introduction of evidence of defendant’s prior criminal record. We disapprove of this endeavor and adhere to the rule that the State cannot rebut or question the presumption of a defendant’s good character unless the defendant first chooses to place his character in issue- [Sjince defendant did not voluntarily elect to place his character in issue, the trial court erred in allowing the State to attempt to impeach defendant and place his character in issue through the introduction of evidence of defendant’s prior criminal record.” [Arnold v. State,] 193 Ga.App. [206,] at 207-08, 387 S.E.2d [417,] at 419 (1989).
“ *We conclude that the reasoning of the Arnold court is persuasive here. The justification the State offered in this present case for the admission of the evidence of the defendant’s prior uncharged violent conduct, i.e., that his answers on cross-examination indicating that he was not violent opened the door to questions regarding his character, is due to be rejected. It may not be said that the defendant chose to put his character at issue merely by responding to the prosecutor’s cross-examination designed to elicit testimony on that subject.’ ”
Ex parte Ray, 52 So.3d at 561-62 (quoting Ex parte Woodall, 730 So.2d at 661-62).
Here, just as in Ex parte Ray, the State pursued a line of questioning during *422cross-examination designed to compel Hammond to respond to questions that would place his character in issue and to ensure an excuse for the State’s introduction of evidence of Hammond’s prior sexual abuse of his cousin. Hammond stands in the same position as the defendant in Ex parte Ray, and “ ‘[i]t may not be said that [Hammond] chose to put his character at issue merely by responding to the prosecutor’s cross-examination designed to elicit testimony on that subject.’ ” Ex parte Ray, 52 So.3d at 562. Because the prosecution cannot open the door to rebuttal based on its own questioning on cross-examination, the circuit court erred when it allowed the State to present Hammond’s cousin as a rebuttal witness.
The State contends, alternatively, that regardless of the holding in Ex parte Ray, the rebuttal evidence was admissible against Hammond “in its own right” under Rule 404(b), Ala. R. Evid., to show motive.1 Rule 404(b), Ala. R. Evid., provides:
“Evidence of other crimes, wrongs, or acts is not admissible to prove the character of a person in order to show action in conformity therewith. It may, however, be admissible for other purposes, such as proof of motive, opportunity, intent, preparation, plan, knowledge, identity, or absence of mistake or accident, provided that upon request by the accused, the prosecution in a criminal case shall provide reasonable notice in advance of trial, or during trial if the court excuses pretrial notice on good cause shoum, of the general nature of any such evidence it intends to introduce at trial.”
(Emphasis added.)
The record on appeal indicates that the trial in this case began on Tuesday, February 8, 2011. Before the trial began, the State filed no pretrial notice of its intent to introduce collateral-act evidence under Rule 404(b). On Friday, February 11, 2011, however, the State notified the court that a witness — K.X.—had come forward with similar allegations against Hammond. During a bench conference, the prosecutor explained the late notice as follows:
“I have information that I just received yesterday that this defendant has done the exact same thing to another member of his family when she was thirteen years of age, I have every right to ask him if that happened and I have every right to put her on the stand in rebuttal to tell about what did happen.
“I did not offer it in my case-in-chief. I did not try to re-open my case this morning, because I just found out about the information yesterday — excuse me, Wednesday evening. And we just located the witness yesterday.”
(R. 409-10.) At the time the State informed the circuit court that K.X. had come forward, Hammond had already taken the stand and had testified on his own behalf at trial.
The representations made by the prosecutor clearly demonstrate that the State did not immediately notify defense counsel after it learned that a witness had come forward with information regarding Hammond’s prior bad acts. Instead, the State waited almost two days to notify the circuit court and Hammond that K.X. had come forward, at which point Hammond had already taken the stand to testify in his defense. Therefore, Hammond’s decision to testify was made without the knowledge of the State’s intent to call K.X. to testify regarding Hammond’s prior bad acts.
The facts of this case exemplify the necessity of reasonable notice — pretrial or *423otherwise — under Rule 404(b). In the instant ease, reasonable notice as contemplated by Rule 404(b) would have been timely notice. Although we cannot say for certain that Hammond would have declined to take the stand to testify in his defense had he been timely notified that K.X. had come forward with her own rape allegations, we can certainly say that, had Hammond received timely notice, he would have been able to make a more informed decision regarding whether to testify in his defense. Further, had Hammond received reasonable notice of the State’s intent to introduce collateral-act evidence pursuant to Rule 404(b), he could have then requested that the circuit court give the jury a limiting instruction regarding the Rule 404(b) evidence. See Huddleston v. United States, 485 U.S. 681, 691-92, 108 S.Ct. 1496, 99 L.Ed.2d 771 (1988)(holding that, when evidence of a defendant’s other crimes, wrongs, or acts is introduced under Rule 404(b), Fed.R.Evid., “the trial court shall, upon request, instruct the jury that the similar acts evidence is to be considered only for the proper purpose for which it was admitted”); accord Ex parte Bill-ups, 86 So.3d 1079, 1085 (Ala.2010); Marks v. State, 94 So.3d 409, 413 (Ala.Crim.App.2012). Therefore, we cannot agree with the State that KX.’s testimony was admissible under Rule 404(b), given the particular facts of this case.
Moreover, the circuit court’s error in allowing K.X. to testify in this case cannot be considered harmless. The harmless-error rule provides, in pertinent part:
“No judgment may be reversed or set aside ... on the ground of ... improper admission or rejection of evidence, ... unless in the opinion of the court to which the appeal is taken or application is made, after an examination of the entire cause, it should appear that the error complained of has probably injuriously affected substantial rights of the parties.”
Ala. RApp. P. 45. In Ex parte Crymes, 630 So.2d 125 (Ala.1993), the Alabama Supreme Court further explained:
“In determining whether the admission of improper testimony is reversible error, this Court has stated that the reviewing court must determine whether the ‘improper admission of the evidence ... might have adversely affected the defendant’s right to a fair trial,’ and before the reviewing court can affirm a judgment based upon the ‘harmless error’ rule, that court must find conclusively that the trial court’s error did not affect the outcome of the trial or otherwise prejudice a substantial right of the defendant.”
630 So.2d at 126 (internal citations omitted in original). See also Ex parte Greathouse, 624 So.2d 208, 211 (Ala.1993) (holding that the proper harmless-error inquiry asks, absent the improperly introduced evidence, “is it clear beyond reasonable doubt that the jury would have returned a verdict of guilty”).
Our review of the record indicates that the State’s questioning on cross-examination and the testimony of Hammond’s cousin prejudiced Hammond to the point of calling into question the validity of his conviction. The State’s questioning of Hammond on cross-examination was highly prejudicial and was intended to force Hammond to put his character in issue, thus opening the door for the prosecution to call a rebuttal witness. Without K.X.’s rebuttal testimony, the only evidence presented for the jury’s consideration was Hammond’s word against his accuser’s; so K.X.’s testimony that tended to show Hammond preyed on his adolescent relatives may well have affected the outcome of the trial. Accordingly, the trial court’s *424error cannot be dismissed as harmless, and Hammond’s conviction must be reversed.
Because we are reversing Hammond’s conviction based on the circuit court’s error in allowing Hammond’s cousin to testify as a rebuttal witness, we need not address Hammond’s other contentions pertaining to the circuit court’s failure to grant a new trial based on newly discovered evidence and the circuit court’s refusal to allow a Department of Human Resources’ report into evidence.
Based on the foregoing, the judgment of the circuit court is reversed, and this case is remanded for proceedings consistent with this opinion.
REVERSED AND REMANDED. .
WINDOM, P.J., and WELCH, BURKE, and JOINER, JJ., concur.. We note, however, that the prosecutor’s position below was that Rule 404(b) was inapplicable in this instance because ICX.'s testimony was not being offered as part of the State's case-in-chief. (R. 415-16.)