
158 N.W.2d 504 (1968)
STATE of Minnesota ex rel. Billy Joe BLACK, Appellant,
v.
Ralph H. TAHASH, Warden, Minnesota State Prison, Respondent.
No. 40679.
Supreme Court of Minnesota.
April 19, 1968.
*505 C. Paul Jones, Public Defender, Murray L. Galinson, Robert E. Oliphant, Asst. Public Defenders, Minneapolis, for appellant.
Douglas M. Head, Atty. Gen., Gerard W. Snell, Acting Sol. Gen., David J. Byron, Sp. Asst. Atty. Gen., St. Paul, for respondent.
Heard before KNUTSON, C. J., and NELSON, OTIS, SHERAN, and FRANK T. GALLAGHER, JJ.

OPINION
FRANK T. GALLAGHER, Justice.
Appeal from an order of the district court dismissing a writ of habeas corpus.
Relator, Billy Joe Black, was charged by information with the crime of aggravated robbery. He retained counsel to defend him against this charge. After a jury trial, he was found guilty, convicted, and sentenced on February 24, 1964, to an indeterminate term of up to 20 years. An alleged accomplice, Julius Andrews, was acquitted in a separate trial. Relator did not prosecute a direct appeal.
On August 1, 1966, relator filed a petition for habeas corpus. The principal charges in the petition were that relator was denied counsel while under interrogation; that his privilege against self-incrimination was violated; that certain evidence used against him at trial was obtained as a result of illegal search and seizure; and that at trial a witness referred to relator's previous imprisonment, thus depriving him of a fair trial. A writ of habeas corpus was issued and a hearing was held in the Washington County District Court. Relator was represented by the public defender. At this hearing it was alleged, in addition to the charges made in the petition, that relator's trial counsel did not represent him competently. The writ was dismissed on the merits by an order dated December 17, 1966, and the sole issue raised on this appeal is whether relator's trial attorney competently represented him.
Milton Wellnitz, one of the officers who had arrested relator, testified for the state at trial. After eliciting the fact that Officer Wellnitz had accompanied relator to the police station, the prosecuting attorney asked him what relator had said while they were in the squad car on the way to the station. The officer replied:
"I asked Billy Joe when was the last time he saw Julius Andrews, and he stated that he had only seen him once since leaving Stillwater."
Relator's attorney objected immediately. The judge sustained the objection, instructed the jury to disregard the answer, and cautioned the officer not to make such statements. Defense counsel then asked to approach the bench. After a discussion at the bench, the court announced a recess. During the recess, defense counsel conferred with relator. At the end of that *506 conference, defense counsel announced that he had explained to relator the damage which may have been caused by the officer's remark and had informed him that the remark might well provide a basis for a mistrial. Relator then stated that, after weighing what counsel had told him, he had decided not to move for a mistrial. His charge of incompetence now is counsel's failure at this point to move for a mistrial.
There is no doubt that the officer's remark constituted prejudicial error which provided grounds for a mistrial. The rule in Minnesota, as elsewhere, is that evidence of a defendant's prior criminal activity is inadmissible in a criminal prosecution. State v. Gress, 250 Minn. 337, 84 N.W.2d 616. There are exceptions to this rule, but none which apply to this case. What is thus inadmissible directly cannot be injected by indirection. The state will not be permitted to "deprive a defendant of a fair trial by means of insinuations and innuendoes which plant in the minds of the jury a prejudicial belief in the existence of evidence which is otherwise inadmissible." State v. Currie, 267 Minn. 294, 301, 126 N.W.2d 389, 395. Use of such insinuation is reversible error whether the allusion to prior misconduct is contained in the question which the prosecutor asks or in the answer which his witness gives. State v. Huffstutler, 269 Minn. 153, 130 N.W.2d 347. In State v. Gegen, 275 Minn. 568, 147 N.W.2d 925, a case virtually identical to this one in that an officer recounted a conversation in which the defendant had disclosed prior criminal activity, this court reversed the trial court for failure to grant a motion for mistrial. The right to a mistrial in the circumstances of this case is thus well settled.
But it does not necessarily follow that trial counsel's failure to ask for a mistrial deprived relator of his right to adequate representation. A defendant in a criminal prosecution will be granted a new trial based on inadequacy of counsel only if the inadequacy is such as to render the trial a sham. State v. Waldron, 273 Minn. 57, 139 N.W.2d 785. The inadequacy must be particularly flagrant where, as here, relator selected his own trial counsel. State v. Russell, 272 Minn. 463, 138 N.W.2d 690. Here, his counsel at the time of trial was obviously aware of relator's right to ask for a mistrial. He discussed that possibility with relator. Relator testified at the hearing on the habeas corpus petition that counsel had advised him that he had the best jury possible and that a new trial would necessitate a new jury. He admitted that counsel had not advised him outright that a mistrial was inadvisable. From this it appears that counsel, well aware of the alternatives, concluded as a matter of strategy that it would be advisable to continue with the trial and that relator, without being unduly pressured, agreed with him. Set in this context, defense counsel's failure to request a mistrial does not constitute incompetence. It is significant in this regard that relator did not allege incompetence of counsel in his habeas corpus petition. It was only at the hearing on the petition that he made this charge.
It follows that the trial court properly dismissed the writ.
Affirmed.
