delivered the opinion of the court:
The defendant, Vernon R. Weakley, was indicted for the crime of burglary in McLean County and was arraigned in open court on May 9, 1966, at which time he was furnished with a copy of the indictment. The court explained to him the nature of the indictment and inquired of the defendant as to his age. The defendant stated that he was 17 years of age and that he had counsel of his own choosing who was not present in court and that he desired to enter a plea of not guilty. Bond was fixed at the sum of $2,000 and upon his failing to enter bond in that amount he was remanded to the McLean County jail pending trial.
On June 3, 1966, the defendant appeared in person in open court with different counsel, namely the assistant public defender of McLean County, and moved to withdraw his plea of not guilty which he had previously entered. The motion was allowed and, after the court had advised him of his right to a trial by jury, the defendant entered a plea of guilty to the charges of the indictment, which plea was accepted by the court. A petition for probation was filed which was referred to the probation officer for investigation and report, and the defendant was remanded to the county jail pending the report of the probation officer.
On June 13 the defendant again appeared in open court with his then counsel, the assistant public defender, at which time the report of the probation officer was received and a hearing was held on the petition for probation, which hearing resulted in the defendant being admitted to probation for a period of 18 months.
On November 2, 1966, a petition for revocation of defendant’s probation was filed and a bench warrant was ordered and issued immediately for his apprehension. On November 7, 1966, the defendant appeared in person in open court with a different attorney selected by him. The petition for revocation of probation was heard and denied but there was added as a condition to the probation the *551condition that the defendant was to make restitution of all outstanding checks, pay his attorney’s fees and be incarcerated at the Illinois State Penal Farm at Vandalia, Illinois, for a term of 60 days.
On February 23, 1967, the defendant again appeared in open court when a petition for revocation of his probation was filed. At that time the assistant public defender of McLean County was appointed by the court to represent the defendant temporarily and hearing on the petition was set for March 2, 1967. On said later date the defendant appeared in person in open court with different counsel of his own choosing and a hearing was had on the petition to revoke defendant’s probation, which resulted in the probation being revoked and the court sentencing the defendant to the Illinois State Penitentiary for a minimum term of 5 years and a maximum term of 10 years.
Subsequently, in May, 1969, the defendant filed in the circuit court of McLean County a motion to file and proceed in forma pauperis under the Post-Conviction Hearing Act and filed a petition for hearing under the Act. The petition stated under oath that the counsel who represented the defendant was incompetent and used lies and tricks to induce the defendant to plead guilty. He asserted that his constitutional rights had been violated by this action. He further filed a motion for appointment of counsel and counsel was appointed by the court to represent him in the post-conviction hearing.
The State’s Attorney filed a motion to dismiss the petition for post-conviction hearing, asserting that the petition made no allegations of fact or law which would justify a hearing on the matter, but merely verbalized conclusory allegations without form or substance sufficient to define in what manner and in what form any particular constitutional right of the defendant had been violated.
On the hearing on the motion for dismissal of the petition for post-conviction hearing, the defendant was present *552in open court along with his court-appointed counsel. However, the defendant was not called to testify, although his counsel stated “if a hearing were held the only basis of the hearing on this Petition, as I understand it from conferring with Mr. Weakley and from correspondence with him, would be the fact that the plea of guilty was coerced and that he was represented by incompetent counsel and that the counsel at the time of the plea induced him into entering a plea of guilty, and this would be the sole basis of the Petition at this time”.
We have reviewed carefully the record of the proceedings concerning the entry of the plea of guilty and, while we find that the court carefully explained to the defendant that he was entitled to a jury trial and interrogated the defendant as to whether or not any promises or threats had been made to him which prompted him to change his plea of not guilty to guilty and that the trial judge before accepting the plea of guilty most carefully questioned the defendant as to whether or not he was entering the plea of his own free will and accord, nowhere does it appear that the court advised him of the consequences of his plea of guilty and what the maximum punishment could be.
In the case of People v. Ballheimer, 37 Ill.2d 24, we held that section 115 — 2(a)(2) of the Code of Criminal Procedure (Ill. Rev. Stat. 1965, ch. 38, par. 115 — 2(a)(2)) provided that a plea of guilty would be accepted only when “the court has informed the defendant of the consequences of his plea and of the maximum penalty provided by law which may be imposed upon acceptance of such plea.”
In the case of People v. Evans, 37 Ill.2d 27, we held that if the admonishment by the trial court was improper the law of waiver would be inapplicable since the defendant could not have knowingly and intelligently waived his constitutional rights.
We believe that section 115 — 2 of the Code of Criminal Procedure (Ill. Rev. Stat. 1967, ch. 38, par. 115 — 2), which *553provides that before or during trial a plea of guilty may be accepted when (1) the defendant enters a plea of guilty in open court, and (2) the court has informed the defendant of the consequences of his plea and of the maximum penalty provided by law which may be imposed upon acceptance of such plea, requires that the court shall explain to the defendant the maximum penalty provided by law and that he cannot rely upon this being stated to the defendant by defendant’s counsel, whether appointed or selected by the defendant.
In the case at bar, while the record shows great concern by the court for the rights of the accused, it does not show that the court advised the defendant as to the maximum penalty provided by law which may be imposed upon acceptance of the plea of guilty. We therefore hold that the defendant is entitled to withdraw the plea of guilty, including the waiver of a jury, and to have a trial under the charges of the indictment.
It is unnecessary for us to consider the charge made by the defendant as to the incompetence of his counsel since this will not be relevant in the trial under the original indictment. The dismissal order is reversed and the cause is remanded for proceedings in accordance with the views herein expressed.
Reversed and remanded, with directions.