
91 Ill. App.2d 191 (1968)
234 N.E.2d 79
The People of the State of Illinois, Plaintiff-Appellee,
v.
Robert Fitzgerald, Defendant-Appellant.
Gen. No. 51,699.
Illinois Appellate Court  First District, Fourth Division.
January 15, 1968.
*192 Starke, Anglin, Savage, Frazin, Stewart & May, of Chicago (Howard T. Savage, Elliott L. DuBois, and Mayme Spencer, of counsel), for appellant.
Daniel P. Ward, State's Attorney of Cook County, of Chicago (Arthur H. Zimmerman, Assistant State's Attorney, of counsel), for appellee.
MR. JUSTICE ENGLISH delivered the opinion of the court.

CRIME CHARGED
Public indecency. Ill Rev Stats (1965), c 38, § 11-9.

JUDGMENT
On a plea of guilty, defendant was sentenced to six months in jail.

CONTENTIONS ON APPEAL
(1) The court erred in accepting defendant's plea of guilty without informing him of the consequences of his plea and of the maximum penalty for the crime charged.
(2) The court erred in failing to impanel a jury to determine defendant's competency.

OPINION
[1] As to both of defendant's contentions on appeal the State's Attorney has confessed error, requesting that the judgment be reversed and the cause remanded for a new trial. Since agreement of the parties cannot control *193 such a judicial function of this court, we have been required to examine the record to see if the conduct of the proceedings by the trial judge did, indeed, demonstrate the errors alleged and confessed. People v. Kelly, 66 Ill. App.2d 204, 209, 214 NE2d 290; People v. Allen, 71 Ill. App.2d 283, 284, 218 NE2d 837; People v. Colston, 81 Ill. App.2d 75, 77, 225 NE2d 801.
[2] The Code of Criminal Procedure provides that a plea of guilty may be accepted only after the court has informed the defendant of the consequences of such a plea and of the maximum penalty which might be imposed. Ill Rev Stats (1965), c 38, § 115-2(a) (2). This record discloses that without the making of any statement to defendant, and without questioning him to ascertain his comprehension of the procedure and its consequences, defense counsel entered a plea of guilty and the court forthwith made a finding of guilty on the plea. This, of course, cannot be countenanced, as it represents a complete breakdown in the safeguards carefully constructed through the years to protect a defendant in the taking of so vital a step as pleading guilty to a criminal charge. See People v. Ballheimer, 37 Ill.2d 24, 224 NE2d 811, and the cases there cited.
[3] The record also discloses that facts presented to the court by defendant himself, by his counsel, by the State's Attorney and by a probation officer raised a serious question as to defendant's competence to stand trial. Without going into detail, suffice it to say that these facts were sufficient to give the court reason to believe that defendant was incompetent. Ill Rev Stats (1965), c 38, § 104-2. Failure to conduct a competency hearing under these circumstances constituted a clear violation of the statute.

DECISION
We agree with the parties that the trial court committed reversible errors. The judgment is therefore reversed, *194 and the cause remanded for a new trial which is to be commenced, however, only if defendant is first found competent in proceedings conducted pursuant to the statute last cited above.
Reversed and remanded with directions.
McCORMICK, P.J. and DRUCKER, J., concur.
