
510 S.W.2d 922 (1974)
Tommy Ray FAZ, Appellant,
v.
The STATE of Texas, Appellee.
Nos. 48589-48592.
Court of Criminal Appeals of Texas.
June 19, 1974.
Rehearing Denied July 17, 1974.
*923 Abraham D. Ribak and James W. Shoff, II, San Antonio (Court-appointed on appeal only), for appellant.
Ted Butler, Dist. Atty., Gordon V. Armstrong and Douglas C. Young, Asst. Dist. Attys., San Antonio, and Jim D. Vollers, State's Atty., Austin, for the State.

OPINION
ONION, Presiding Judge.
Appellant was convicted of three offenses of robbery by assault (Cause Nos. 48,589, 48,590, 48,591) and of burglary with the intent to commit theft (Cause No. 48,592). Punishment in each case was assessed by the court at ten (10) years. The sentences were ordered to run concurrently. Appellant appeals each case on identical grounds of error.
*924 The appellant waived a jury trial and entered a plea of guilty before the court to each of the four separate charges.
In three grounds of error appellant complains that the trial court erred in accepting his plea of guilty without inquiring into the defensive issue of his sanity at the time of the commission of the offenses when such issue was raised by evidence offered at a previous hearing on the issue of competency to stand trial before another judge. It is observed that appellant complains not that the trial court failed to withdraw the plea of guilty, but that the court failed to inquire as to a defense.
The record reflects that on September 7, 1971, appellant's court-appointed trial counsel filed a motion for a preliminary sanity hearing to determine whether appellant was competent to stand trial and attached thereto several exhibits, one of which was a letter dated May 21, 1971, from Dr. Allen C. Chittenden diagnosing the appellant as presently incompetent to stand trial but sane at the time the offenses were committed.
On December 2, 1971, a hearing on said motion was held before the Honorable Peter Michael Curry, sitting as Judge of the 186th District Court. During the hearing, Dr. James B. Polka, a licensed psychiatrist, testified that after examining the appellant he was of the opinion that the appellant was mentally ill and unable to assist counsel in his defense. Dr. Polka further testified that appellant's diagnosed illness of schizophrenia had developed gradually over a period of years, but the witness could not express an opinion as to appellant's mental condition at the time the offenses were committed.
At the same hearing appellant's counsel and the State stipulated to another letter dated November 17, 1971, from Dr. Chittenden disclosing that if called to testify he would express the opinion that the appellant is presently insane and was insane at the time the offenses were committed.
At the conclusion of the hearing the jury was instructed on the issue of present insanity (competency to stand trial), and if they found the appellant was presently insane, whether such condition would require hospitalization. After an affirmative finding on both issues, the appellant was adjudged presently incompetent to stand trial and was transferred to Rusk State Hospital on December 9, 1971.
The record further reflects that on August 21, 1972, the appellant was certified as sane to the committing court and on December 11, 1972, a restoration sanity hearing was held before the Honorable James E. Barlow, at the conclusion of which the jury returned a verdict that the appellant was presently sane.
Thereafter, on July 10, 1973, appellant and his counsel appeared before Judge Barlow and announced that he was changing his plea from not guilty to guilty in each case. The trial court then carefully and exhaustively inquired into appellant's understanding of the charges against him, determined that appellant was pleading guilty because he was guilty, advised him of the range of punishment (consequences of his plea), and determined after lengthy inquiry that he was not prompted to plead guilty because of fear, persuasion, delusive hope of pardon, coercion, force, promises, etc. On the issue of competency to stand trial, the following exchange is reflected:
"THE COURT: There has been a psychiatric evaluation, there is a letter from the psychiatrist in the record which I will take into consideration on the issue of his sanity.
"MR. ARMSTRONG: Yes, sir; and each copy of the stipulationsthe State has made a Xerox copy of the letter from Dr. L. D. Neal, M.D. (sic), Superintendent of Rusk State Hospital, and it is made an attachment of the stipulations in each cause.
"THE COURT: All right. I will consider that in the consideration of the plea itself."
*925 No issue was made at the time the pleas were entered regarding the appellant's sanity at the time of trial or at the time of the commission of the offenses.
Appellant does not claim that the court failed to admonish him as to the consequences of his pleas, nor does he claim that the court failed to inquire into the matter of present sanity. Rather, his complaint is that since Dr. Chittenden's letter dated November 17, 1971, was admitted at the preliminary hearing the trial court should have, sua sponte, upon the entry of the guilty pleas, inquired further into the matter of the defensive issue of sanity at the time the offenses were committed.
In Taylor v. State, 88 Tex.Cr.R. 470, 227 S.W. 679 (1921), the court wrote:
"... The question of sanity, when such plea of guilty is offered, is for the court and relates solely to the mental condition of the accused when making his plea, and not to such condition when the offense was committed. The act of pleading guilty to the commission of a crime, a felony which involves disgrace and heavy penalties, is so against his interest that it pleased the mericiful framers of our laws to assume that a man would not do so in his right mind, and when free from hostile influences. So that the inquiry in such case is confined to the time of the plea and is only for the court...." (Emphasis supplied)
Further, since the issue of insanity at the time of the commission of an offense is primarily a defensive one, it should be raised during the course of the trial. See Fuller v. State, 423 S.W.2d 924 (Tex.Cr.App.1968); Newton v. State, 509 S.W.2d 610 (Tex.Cr.App. delivered May 22, 1974).
If the defense of insanity at the time of the commission of the offense is sufficiently raised during the taking of a guilty plea or plea of nolo contendere before the court, the court should then give the accused the right to withdraw his plea and enter a plea of not guilty, and if he does not, then the court shall enter a plea of not guilty for him. See and compare Edwards v. State, 114 S.W.2d 572 (Tex. Cr.App.1938); Thompson v. State, 127 Tex.Cr.R. 494, 77 S.W.2d 538 (Tex.Cr. App.1934); Yantis v. State, 255 S.W. 180, 182 (Tex.Cr.App.1923).[1]
Thus, it is clear that if the evidence sufficiently raises a defensive issue the court is required to withdraw the guilty or nolo contendere plea if the accused does not enter a plea of not guilty. The procedure does not simply call for the court to make inquiry, as apparently contended by appellant.
During the trial on these guilty pleas, there was no evidence offered raising the defensive issue in question, and we cannot agree that such issue was raised by evidence heard by another judge in a preliminary hearing.
Appellant's foregoing grounds of error are overruled.
Finally, appellant complains that his court-appointed trial counsel were incompetent "in that they permitted the appellant to enter pleas of guilty knowing that at the time of the offenses charged, he was legally insane."
Appellant's court-appointed counsel on appeal, unlike his court-appointed trial counsel, argues that Dr. Chittenden's letter dated November 17, 1971, offered and stipulated into evidence at the preliminary sanity hearing, was of sufficient strength to *926 require trial counsel to pursue said issue and that their failure to do so denied the appellant the right to effective counsel.
An examination of the record reveals several medical opinions by qualified psychiatrists concerning the appellant's state of mind.
It should be reiterated, however, that the letter that forms the basis for appellant's complaint now on appeal is inconsistent with the opinion earlier expressed by the same psychiatrist in a letter dated May 21, 1971, which was attached as an exhibit to appellant's motion for a preliminary hearing on the present insanity issue. To hold that the letter of November 17 was sufficient to prohibit counsel from permitting the appellant from ever entering pleas of guilty would have the effect of this court second-guessing the representation appellant received from his two court-appointed trial counsel without the benefit of any evidence or testimony concerning their investigation of the case or consultations with the psychiatrists, etc.
It should also be noted that prior to appellant's pleas of guilty for the offenses charged the three robbery by firearms charges were reduced to the lesser included offenses, and, in exchange for appellant's pleas of guilty, the State recommended ten years' confinement in the Department of Corrections. Further, counsel's failure to assert insanity as a defense appears to have been a strategical move, the propriety of which is not open to question under these circumstances. In light of the seriousness of the punishment, should the defense fail, it cannot be said that the decision was inadvisedly made.
The adequacy of an attorney's services on behalf of the accused must be gauged by the totality of the circumstances, Satillan v. State, 470 S.W.2d 677 (Tex.Cr.App.1971); Witt v. State, 475 S. W.2d 259 (Tex.Cr.App.1971), and allegations of ineffective representation will be sustained only if they are firmly founded. See Long v. State, 502 S.W.2d 139 (Tex. Cr.App.1973); Howard v. Beto, 466 F.2d 1356 (5th Cir. 1972).
After reviewing the entire record, we cannot conclude that the appellant was denied the effective assistance of counsel, that counsel was incompetent or that his pleas were involuntary.
Appellant's last ground of error is overruled.
For the reasons stated, the judgments are affirmed.
NOTES
[1]  Under the former Code of Criminal Procedure 1925 a plea of not guilty in a felony case had to be heard before a jury, so when the accused or court withdrew the plea and entered a plea of not guilty, a jury was required to be impaneled where the plea had been entered before the court. Under the present Code the trial court may hear either a guilty or not guilty plea and a jury is not required unless the death penalty is applicable.
