Defendant appeals his conviction by a jury of murder, in the first degree. We reverse.
While incarcerated in the Denver County Jail, defendant was charged with the murder of a fellow inmate. Defendant first pled not guilty by reason of insanity, but after a court-ordered psychiatric examination was made, pursuant to § 16-8-101, et seq., C.R.S.1973 (1978 Repl. Vol. 8), which concluded that defendant was sane, defendant withdrew the insanity plea, and entered a plea of not guilty.
On the morning of the trial, defendant personally objected to proceeding to trial, arguing that the defense was not ready for trial because two defense witnesses had not been subpoenaed. In the presence of the trial judge, defendant’s court-appointed counsel explained that he was prepared to go to trial, but that he “refused to affirmatively put on evidence that [he knew] was fabricated.” After further consultation with defendant, both defendant and his counsel moved that counsel be permitted to withdraw from the case. These motions were denied.
*713Trial counsel and defendant then retired to the jury room where, in the presence of the court reporter, they described for the record the basis of the disagreement which led to their above-described motions. Counsel stated that as a result of conversations with defendant, and as a result-of conversations had between defendant and an examining psychiatrist, he would not call two witnesses who would testify that at the time of the murder defendant was with them. In essence, counsel stated that he refused to call two alibi witnesses because he “knew” that they would present perjured testimony.
Trial counsel proceeded to represent defendant at trial. The two alibi witnesses were not called, and defendant was convicted.
I.
On appeal, defendant contends that the trial court should have compelled trial counsel to call the two alibi witnesses, or, alternatively, the court should have granted trial counsel’s request to withdraw, and that the court’s failure to follow either of those courses denied defendant effective assistance of counsel.1 Although there is no doubt as to the constitutional right of a criminal defendant to effective assistance of counsel, Faretta v. California, 422 U.S. 806, 95 S.Ct. 2525, 45 L.Ed.2d 562 (1975); People v. Moya, 180 Colo. 228, 504 P.2d 352 (1972), we, nevertheless, catagorically reject defendant’s position that this constitutional right is so predominant that it overrides an attorney’s duties as an officer of the court.2
An attorney who represents a criminal defendant has a duty to represent his client zealously as an advocate, and to present all possible defenses. Code of Professional Responsibility EC 7 — 1; Anders v. California, 386 U.S. 738, 87 S.Ct. 1396, 18 L.Ed.2d 493 (1967); In re Branch, 70 Cal.2d 200, 74 Cal.Rptr. 238, 449 P.2d 174 (1969). But, a defendant’s right to effective assistance of counsel and an attorney’s duty to his client do not mean that an attorney has a duty to present testimony that he knows to be perjured. In re Branch, supra; People v. Pike, 58 Cal.2d 70, 22 Cal.Rptr. 664, 372 P.2d 656 (1962). In fact, the Code of Professional Responsibility DR 7-102(A) specifically states that: “In his representation of a client, a lawyer shall not: ... (4) [kjnowingly use perjured testimony or false evidence.” Given this affirmative duty, even in the face of a criminal defendant’s constitutionally based right to effective assistance of counsel, we hold that an attorney shall not use testimony that he knows is perjured- Thus, contrary to defendant’s contention, the trial court correctly refused to compel trial counsel to present testimony he “knew” to be perjured.
We do, however, agree with defendant that, under the circumstances presented, the court erred in denying trial counsel’s motion to withdraw from the case. In a strikingly similar case, the Ohio Court of Appeals held that the trial court erred in denying defense counsel’s motion to withdraw which motion was premised on the ground that the defendant intended to present perjured testimony to support his defense of alibi. State v. Trapp, 52 Ohio App.2d 189, 368 N.E.2d 1278 (1977). The Ohio court held, and we find its reasoning persuasive, that because the “Code of Professional Responsibility clearly prohibits a lawyer from knowingly using perjured testimony,” trial counsel has a duty to withdraw if his client insists upon such a course. Trapp, supra; Code of Professional Responsibility DR 7-102(B)(2). Further, to require the attorney to continue as defendant’s counsel where there is such a serious disagreement between the attorney and his *714client deprives the defendant of effective assistance of counsel. See Anders, supra; see Trapp, supra.
Here, defendant was denied such effective assistance of counsel because trial counsel acted more as an amicus curiae rather than as an active advocate for defendant. Anders, supra; Barker v. Wainwright, 459 F.2d 8 (5th Cir. 1972). And this denial of defendant’s right to effective assistance of counsel, Faretta, supra; Anders, supra, is reversible error because the right to counsel is a constitutional right so basic to a fair trial that its infraction can never be treated as harmless. Chapman v. California, 386 U.S. 18, 87 S.Ct. 824, 17 L.Ed.2d 705 (1967).
Thus, in summary, we conclude that an attorney’s duty as an officer of the court and his obligations under the Code of Professional Responsibility absolutely preclude an attorney from the knowing use of perjured testimony. When an attorney is confronted with a situation in which his client is intent upon presenting perjured testimony, he has an affirmative duty to withdraw from the case, and under such circumstances, the court must grant the attorney’s motion to withdraw. Therefore, in the instant case, the trial court erred in denying trial counsel’s motion to withdraw.
Defendant also contends that trial counsel breached his duty of maintaining the confidentiality of privileged communications between himself and defendant when trial counsel disclosed to the court that he “refused to affirmatively put on evidence that [he knew] was fabricated.”
When an attorney presents a motion to the court to withdraw from a case because he knows that his client intends to present perjured testimony, he is confronted with the dilemma between informing the court of the grounds which require him to withdraw and his duty to his client to maintain the confidentiality of privileged communications. Section 13-90-107(1), C.R.S.1973 (1979 Cum.Supp.); Code of Professional Responsibility DR 4-101.
The American Bar Association Committee on Ethics and Professional Responsibility dealt with the closely analogous problem of whether an attorney, who learns through a privileged communication that his client has committed perjury, must reveal the past fraud to the court. The A.B.A. stated that, “[t]he tradition (which is backed by substantial policy considerations) that permits a lawyer to assure a client that information (whether a confidence or a secret) given to him will not be revealed to third parties is so important that it should take precedence, in all but the most serious cases, over the duty imposed by DR 7— 102(B).” A. B. A. Committee on Ethics & Professional Responsibility, Formal Opinion 341, September 30, 1975. (Parentheticals in original). Thus, the attorney may not breach his duty of maintaining his client’s confidences even when he knows his client has previously perjured himself. Indeed, in recognition of the preeminence of this duty, Code of Professional Responsibility DR 7— 102(B)(1) was amended in 1974 to carve out an exception to an attorney’s duty to reveal fraud when the knowledge of the fraud is based upon a privileged communication.
We agree that the attorney’s duty to protect privileged communications between himself and his client is paramount. In cases such as the one now before this court, the attorney, when making his motion to withdraw, should maintain silence with respect to all privileged communications. Section 13-90-107(1), C.R.S.1973 (1979 Cum.Supp.); Code of Professional Responsibility DR 4-101; see In re Grievance Commission v. Malloy, 248 N.W.2d 43 (N.D. 1976); see In re A, 276 Or. 225, 554 P.2d 479 (1976). He should inform the court of the “specific provisions of the Code of Professional Responsibility that prohibit a lawyer from using perjured testimony or false evidence and from engaging in conduct involving dishonesty, fraud, deceit, or misrepresentation, and other disciplinary rules which require an attorney’s withdrawal if he knows that his continued employment will result in the violation of a Disciplinary Rule.” Trapp, supra.
*715The trial court may explore the adequacy of trial counsel’s representations regarding his grounds for withdrawal, but in the course of this inquiry, the court may not compel the attorney to disclose any confidential communications.3 See Holloway v. Arkansas, 435 U.S. 475, 98 S.Ct. 1173, 55 L.Ed.2d 426 (1978). Further, when an attorney states to the court that ethical considerations require that he withdraw from a case, the court may rely upon the veracity of the attorney’s statement because “attorneys are officers of the court and ‘when they address the judge solemnly upon a matter before the court, their declarations are virtually made under oath.’ ” Holloway, supra.
Here, trial counsel’s belief that defendant’s alibi witnesses would perjure themselves was based on conversations with defendant, and from reading the court-ordered psychiatric report. Both of these sources were privileged, Code of Professional Responsibility DR 4-101(A); see § 16-8-107(1), C.R.S.1973 (1978 Repl. Vol. 8), and trial counsel should not have revealed the specific facts which led him to move for withdrawal.
II.
Among the issues which may arise again on retrial, defendant cites as error the trial court’s refusal to admit into evidence the prior conviction of the victim, the victim’s use of an alias, his prior use of narcotics, and other evidence of the victim’s character and habits.
Although defendant speculates as to the possible relevancy of this evidence, we find no abuse in the trial court’s determination that the evidence was not relevant. People v. Reynolds, 194 Colo. 543, 575 P.2d 1286 (1978); People v. Bynum, 192 Colo. 60, 556 P.2d 469 (1976).
We also reject defendant’s next contention that the trial court erred in sustaining the prosecution’s objection to the introduction of evidence that the victim had had a prior violent confrontation with another inmate. Our review of the record reveals that defendant failed to introduce any evidence that directly connected this other inmate with the actual crime that was the subject matter of the instant prosecution. We conclude that People v. Mulligan, 193 Colo. 509, 568 P.2d 449 (1977), is disposi-tive of this issue, and that the trial court did not err in sustaining the prosecution’s challenge to this evidence.
Finally, defendant contends that the trial court erred in failing to declare a mistrial following the prosecution’s suggestion, during its opening statement, that the victim had been sexually assaulted. We see no error.
We initially note that the trial court later permitted testimony which referred to the possible sexual assault on the victim, and that the court gave cautionary limiting instructions to the jury on the effect and relevance of this testimony. Because the trial court is in the best position to evaluate the effect of an irregularity on the jury, People v. Becker, 187 Colo. 344, 531 P.2d 386 (1975), its ruling on a motion for a mistrial will not be disturbed absent a clear abuse of discretion resulting in prejudice to the defendant. People v. Saars, 196 Colo. 294, 584 P.2d 622 (1978). Furthermore, it is presumed, in the absence of a showing to the contrary, that the jury understands and follows cautionary instructions. People v. Sepeda, 196 Colo. 13, 581 P.2d 723 (1978). No such contrary showing has been made here, and we perceive no abuse of discretion.
Judgment reversed and cause remanded for new trial.
PIERCE, J., concurs. VAN CISE, J., dissents.. Although defendant’s motion to have counsel removed was also denied, this denial was not raised in defendant’s motion for new trial, nor was it raised in defendant’s brief or oral argument before this court.
. Appellate counsel has cited no judicial authority for his position; however, he does find support in M. Freedman, Professional Responsibility of the Criminal Defense Lawyer: The Three Hardest Questions, 64 Michigan L.Rev. 1469 (1966), and in M. Freedman, Lawyers’ Ethics in An Adversary System (1975).
. As Justice Black noted in his dissenting opinion in Williams v. Florida, 399 U.S. 78, 90 S.Ct. 1893, 26 L.Ed.2d 446 (1971), “A criminal trial is in part a search for truth.” This concept has its roots in nineteenth century English jurisprudence: “Truth, like all good things, may be loved unwisely-may be pursued too keenly-may cost too much.” Pearse v. Pearse (1846) 1 De G. & Sm. 12 at 28, per Knight Bruce V.-C.