*255OPINION
Per Curiam:Following a joint trial, a jury found both appellants Layton and Eckert guilty of one count of attempted murder and one count of battery with a deadly weapon. They now appeal their convictions.
At trial, Eckert testified that he and an unidentified accomplice had been involved in the attack on the victim. On cross-examination, however, Eckert refused to reveal the identity of his accomplice, stating only that Layton had not been involved in the attack. As a sanction for his refusal to identify his accomplice, the trial court instructed the jury to disregard Eckert’s testimony in its entirety.
Both appellants assert that the trial court erred in its decision to strike Eckert’s testimony, contending that their right to present evidence on their own behalf was thereby violated. We disagree.
A witness may not take the stand to testify and then refuse to answer questions on cross-examination relating to his testimony given on direct examination. See United States v. Panza, 612 F.2d 432, 438 (9th Cir. 1979) cert. denied, 447 U.S. 925 (1980). If a witness refuses to answer such questions, it is within the trial court’s discretion to apply any of several sanctions against the witness, including the sanction of striking all of the witness’ testimony.1 See United States v. Panza, supra.
Although a trial court should always take into consideration a defendant’s right to present evidence on his own behalf, the sanction of striking testimony may nevertheless be applied to both a defense witness and to a defendant testifying on his own behalf. See United States v. Panza, supra at 438-39; People v. Carter, 293 N.W.2d 681, 685 (Mich.Ct.App. 1980); Peters v. State, 233 N.W.2d 420, 428 (Wis. 1975). This sanction may only be applied, however, when the witness refuses to answer questions which relate to relevant and material issues. See, e.g., Peters v. State, supra at 427-28. It would be an abuse of discretion to strike testimony for a refusal to answer questions *256involving merely “collateral” matters. See United States v. Panza, supra at 438-39; Peters v. State, supra at 427-28. Furthermore, a district court should not strike a defendant’s testimony without first making the defendant aware of the possible consequences of his refusal to answer, and giving him a fair opportunity to answer. See United States v. Panza, supra at 439.
In the present case, Eckert was repeatedly warned that his testimony would be stricken if he refused to reveal the identity of his accomplice, and he was then given ample opportunity to comply. Moreover, the identity of his accomplice was clearly relevant and material to the issue of the guilt or innocence of both of the appellants. As such, we find no abuse of discretion in the trial court’s decision to strike the testimony.
The judgments of conviction are therefore affirmed.
Other available sanctions include imposing contempt, permitting the prosecutor to comment to the jury on the unprivileged refusal to answer, permitting the prosecutor to impeach the witness by continuing to elicit his unprivileged refusal to answer, and instructing the jury that it may take the witness’ refusal to answer into account when reaching a verdict. See United States v. Panza, supra at 437, 439.