
466 So.2d 991 (1985)
Ex parte Robert Stephen GILCHRIST.
(Re: Robert S. Gilchrist v. State).
83-753.
Supreme Court of Alabama.
March 8, 1985.
*992 T. Jefferson Deen, III, Mobile, for petitioner.
Charles A. Graddick, Atty. Gen., and William D. Little, Asst. Atty. Gen., for respondent.
BEATTY, Justice.
This Court granted certiorari based upon the petitioner's claim that the Court of Criminal Appeals, 466 So.2d 988, erred in failing to address the issue of the propriety of the district attorney's action in testifying as a witness and later acting as a prosecutor in the same case.
Petitioner has employed Rule 39(k), A.R. A.P., to provide facts not included in the opinion below. Those facts sufficiently establish that the district attorney of Mobile County did testify as a prosecution witness and thereafter also acted as a prosecutor of the State's case, examining witnesses and delivering a closing argument.
There is no ironclad rule against a prosecutor's testifying as a witness; the subject is largely one of discretion on the part of the trial judge. Even so, that discretion has been held to be measured against and based upon the necessity for his testimony according to the circumstances of the case. Maund v. State, 254 Ala. 452, 48 So.2d 553 (1950), contains a recitation of the rule as stated in 70 Corpus Juris at 183. That rule contains a strict limitation, however:
"[I]f he [the district attorney] knows before the trial that he will be a necessary witness, he should withdraw and have other counsel prosecute the case."
This aspect of the rule was discussed at length by the Court of Criminal Appeals in Waldrop v. State, 424 So.2d 1345, 1347 (Ala.Crim.App.1983), which also quoted from State v. Hayes, 473 S.W.2d 688, 54 A.L.R.3d 93 (Mo.1971):
"`However, the general and uniform rule is that the right of a prosecuting attorney to testify in a criminal case "is strictly limited to those instances where his testimony is made necessary by the peculiar and unusual circumstances of the case. Even then, his functions as a prosecuting attorney and as a witness should be disassociated. If he is aware, prior to trial, that he will be a necessary witness, or if he discovers this fact in the course of the trial, he should withdraw and have other counsel prosecute the case." [Citations omitted.]'"
The Court of Criminal Appeals continued at 1348:
"This rule has also found expression in the Code of Professional Responsibility of the Alabama State Bar, DR 5-102(A), which provides that where a lawyer is a witness for his client, except as to merely formal matters, he should leave the trial of the case to other counsel. See also Canon 19 of the American Bar Association's Canons of Ethics."
There is no question that the district attorney here knew in advance that he would be a witness in this prosecution. An assistant district attorney apparently was in charge of the State's case and made the State's opening statement. The trial court then called the assistant district attorney and the two lawyers representing the petitioner to the bench for a side-bar conference:

*993 "THE COURT: I'll just ask you on the record if you have an objection to Mr. Galanos, the District Attorney, coming into the courtroom. Mr. Harrison, you say he will be a witness?
"MR. HARRISON: I anticipate he will be a witness to an event that occurred at Church Street at C.I.D. [Criminal Investigation Division].
"THE COURT: To statements made by the defendant?
"MR. HARRISON: Yeah, statements made by the defendant.
"THE COURT: Do you have an objection?
"MR. CLARK: Yes, sir, Judge. We have no objection if he's not going to be a witness, he's the District Attorney and he's entitled to be here, but if he's going to be a witness we would object because Wilbur Williams has been excluded for the record. If you want to send Wilbur out and retain Chris in his place I don't have an objection, but I don't want everybody in the case excluded from the Rule.
"THE COURT: Well, I'm not going to do it, I'm going to make an exception with Mr. Galanos and Mr. Williams. Your objection is overruled."
This objection and ruling referred only to the invocation of the rule regarding the presence of witnesses in the courtroom, and thus applied only to the district attorney's role as a witness. At that point, Mr. Galanos had made no appearance other than as a witness, and, in fact, had not testified.
Later, when the district attorney examined a prosecution witness, Rhoda Lynn Schultz, no objection to his participation was made. Nor was there any defense objection when he argued in opposition to the defense's motion to exclude, or when he made his closing argument before the jury.
At the point when the district attorney assumed the dual role of witness and prosecutor, his conduct offended the rule that both this Court and the Court of Criminal Appeals have heretofore recognized.
It is appropriate, therefore, to quote from Waldrop v. State, supra, at 1348:
"Under the circumstances, allowing the district attorney to continue to prosecute this case and argue to the jury had the effect of allowing him to violate the rule that it is not permissible for the solicitor to make an emphatic statement that the defendant is guilty of the crime charged. White v. State, 294 Ala. 265, 270, 314 So.2d 857 (1975). `(I)t has never been contemplated or allowed that an emphatic statement by a solicitor, of his own knowledge, could be made to the effect that the defendant is actually guilty of the crime charged in the indictment.' Rowland v. State, 31 Ala.App. 605, 607, 20 So.2d 881 (1945).
"In closing argument, the prosecutor also argued his own credibility to the jurya practice condemned in State v. McCuistion, 88 N.M. 94, 537 P.2d 702 (1975).
"So sacred and fundamental is the principle that the jury not be improperly influenced that our Supreme Court has held that it constituted reversible error to allow the Sheriff, who had acted as the bailiff to the jury, to testify as a witness for the State even though there was no testimony of any conversation between the Sheriff and the members of the jury. There the mere `possibility of influence exerted on the jury's verdict by the sheriff-bailiff was sufficient to deprive the defendant of his right to trial by an impartial jury.' Chancellor v. State, 291 Ala. 413, 282 So.2d 242 (1973).
"We fully recognize that the matter of allowing a prosecutor to become a witness is largely within the discretion of the trial judge. However, once the district attorney testifies he should withdraw from the prosecution of that particular trial unless there is some sound and compelling reason which would require his continued service. See State v. Donahue, 315 So.2d 329 (La.1975), where the district attorney was ordered recused because he `was the sole witness of the *994 content of an oral confession which it is acknowledged he will testify to at trial.'
"Our decision is reached only because of the high respect we have for the office of the district attorney and because of our recognition of the power and influence he exerts in the prosecution of a criminal case. Any decision other than the present one seriously jeopardizes and imperils the fact finding process of a trial by jury."
In Waldrop, supra, the district attorney's conduct constituted reversible error. In this case, however, since there was no objection, no error was preserved below, and error cannot be asserted thereon for the first time on appeal. Thomas v. State, 393 So.2d 504 (Ala.Crim.App.1981). The failure to object waived the prosecutorial error. Cf. 6B Ala.Dig. Criminal Law Key Nos. 1028 and 1030(2).
WRIT QUASHED AS IMPROVIDENTLY GRANTED.
TORBERT, C.J., and MADDOX, ALMON, EMBRY and ADAMS, JJ., concur.
FAULKNER, JONES and SHORES, JJ., dissent.
JONES, Justice (dissenting).
I respectfully dissent. I believe the severity of the prosecutorial misconduct, as detailed in the majority opinion, calls for this Court's exercise of its supervisory and inherent power to correct the basic unfairness that permeated this trial. I appreciate the opinion's reliance upon the "preservation of error" rule; but, in my opinion, the ethical considerations here involved transcend that traditional rule and invoke the trial court's affirmative duty to control the conduct of the lawyers as trial counsel and officers of the court.
Look again, if you will, at the cumulative effect of the district attorney's conduct: First, he sat at the counsel table knowing that he was going to testify as a material witness for the State; then, in fact, he did testify; next, he examined and cross-examined witnesses concerning the very matters about which he had testified; and, finally, he argued the State's case to the jury. The gravity of the district attorney's improper conduct is dramatized when we look beneath the surface of these events and recognize that the purpose of his testimony was to contradict the testimony given by the Defendant; and then he compounded the error by arguing to the jury his own credibility.
When it was first brought to the trial court's attention that the district attorney was a potential witness, the court should have given the district attorney a choice: either he could participate at the trial as the State's counsel or he could testify. He could not do both under the instant circumstances. In fact, if the district attorney had been forced to make an election at this point in the trial, pursuant to the clear mandate of the Code of Professional Responsibility, the errors that followed would not have occurred. (It should be noted here that this adverse ruling was properly preserved by an appropriate objection.) As to the applicability of the Code of Professional Responsibility to district attorneys, see Waldrop v. State, 424 So.2d 1345 (Ala. Cr.App.1982).
But, beyond this, when the district attorney was excused from the rule regarding the presence of witnesses in the courtroom, and then presented himself as a witness on behalf of the State, the trial court should have interceded. Because the court did not intercede at this point, when the district attorney further participated in examining and cross-examining witnesses and arguing the case to the jury, the court should have acted on its own, in the interest of basic fairness, to declare a mistrial. Moreover, the trial court's sua sponte action was called for because trial counsel's improper conduct was in open court and in the presence of the judge. See People v. Arends, 155 Cal.App.2d 496, 318 P.2d 532 (1957).
For a good statement of the rule that the trial judge is more than a mere referee in a contest between opposing parties or counsel, see 88 C.J.S. Trial § 36 (1955). While the court is allowed a considerable latitude of discretion in the conduct of the trial, the trial court's not taking corrective action, *995 when required by the facts, is as much an abuse of judicial discretion as an improperly exercised discretion. Strzebinska v. Jary, 58 R.I. 496, 193 A. 747 (1937); and Banister v. Hubbard, 82 Ga.App. 813, 62 S.E.2d 761 (1950).
While the primary line of defense against improper prosecutorial conduct lies with the trial court, an appellate court should not hesitate to correct an error that has not been corrected at the trial level. As succinctly stated in Alschuler, Courtroom Misconduct by Prosecutors and Trial Judges, 50 Tex.L.Rev. 629, 655-56 (1972):
"In deciding what significance to attach to the lack of objection, the courts should consider the effectiveness of the remedy that the trial court would probably have provided, the tactical obstacles that may have stood in the way of an objection (either the fear of provoking jury resentment or the danger of re-emphasizing the prosecutor's improper remarks), the extent to which it is necessary that the defendant suffer for his attorney's carelessness, and the public interest in securing dignified and accurate adjudication.... When these factors enter the balance, there can be no justification for an unyielding requirement of contemporaneous objection."
For the foregoing reasons, I would reverse the judgment of the Court of Criminal Appeals.
