
554 P.2d 44 (1976)
Ronnie Lee ROBINSON, a juvenile, Petitioner,
v.
BOLEY STATE SCHOOL FOR BOYS and the Department of Institutions, Social and Rehabilitative Services, Respondents.
No. H-76-619.
Court of Criminal Appeals of Oklahoma.
August 26, 1976.
*45 ORDER GRANTING IN PART AND DENYING IN PART WRIT OF HABEAS CORPUS, WITH DIRECTIONS
A Petition for Writ of Habeas Corpus was filed in this Court on the 16th day of August, 1976, in which Petitioner seeks his release from confinement in the Boley State School for Boys where he is currently confined under an Order of the District Court, Cleveland County, Case No. JFJ-76-46. Thereafter, a Rule to Show Cause was issued and this matter was set for oral argument at 1:30 p.m. on August 25, 1976, in the Court of Criminal Appeals and Petitioner appeared by counsel, Mr. John Dratz, Juvenile Court Public Defender, Tulsa, Oklahoma, and the Respondents appeared by John Lee Ritter, Consultant for the Department of Institutions, Social and Rehabilitative Services, at which hearing it was stipulated and agreed that when the Petitioner appeared before Judge McDanel, he was represented by counsel and his parents were present and the State appeared by Assistant District Attorney Huff. It was further stipulated and agreed that since the court reporter was not present, no transcript of the proceedings conducted on the Petitioner's plea of guilty was made in the Cleveland County District Court. It was further stipulated that Judge McDanel, who testified in a habeas corpus proceeding in the District Court, Okfuskee County, did not fully apprise Petitioner of all his rights required in criminal proceedings against an adult as set forth in Smith v. Oklahoma City, Okl.Cr., 513 P.2d 1327. Moreover, it was stipulated by the parties that Judge McDanel accepted Petitioner's plea of guilty, notwithstanding Petitioner's assertion at the time the plea was tendered that he was not, in fact, guilty of Larceny of an Automobile, as alleged in the Juvenile Petition.
At the conclusion of said hearing, this Court retired for deliberation and found: (1) that the trial court should not have accepted Petitioner's plea of guilty in light of his assertion that he was innocent, and (2) prior to the acceptance of the plea of guilty the trial court should have advised Petitioner in accordance with Smith v. Oklahoma City, supra, but in all future cases, juvenile courts should advise a juvenile charged with delinquency by virtue of a criminal offense before accepting his plea of guilty, in accordance with the applicable guidelines of this Court's decision in King v. State, Okl.Cr., 553 P.2d 529.
The Court further finds that the Order entered by Judge McDanel on the 11th day of May, 1976, should be vacated and set aside and that Petitioner's plea of guilty should be vacated and the Petitioner accorded an adjudicatory hearing and that counsel be appointed to represent him in any further proceedings conducted in the Cleveland County District Court, Case No. JFJ-76-46.
Now, therefore, the Court further finds that Judge McDanel should vacate the Order heretofore entered in the Cleveland County District Court and direct the proper authorities to proceed to the Boley State School for Boys where Petitioner is presently confined, take him into custody and return him to the jurisdiction of the Cleveland County District Court, without unnecessary delay. Upon his return, the trial court should proceed in accordance with this Order. The Respondent is directed to hold Petitioner in custody and deliver him over to the proper authorities of Cleveland County, provided that in the event the authorities of Cleveland County do not appear *46 and request the delivery of Petitioner within their custody within thirty (30) days from the date of this Order, said Respondents shall discharge the Petitioner from further confinement.
In all future cases, juveniles seeking to attack the validity of an unappealed order of commitment arising from delinquency proceedings founded on a violation of the criminal law, should proceed in the District Court of the County wherein the Order of Commitment is issued under the provisions of 22 O.S. 1971, § 1080, et seq., and not by habeas corpus in the county wherein the Petitioner is confined. In arriving at this conclusion we are not unmindful that the provisions of 22 O.S. 1971, § 1080, et seq. were enacted primarily for the purpose of allowing adults confined under judgments and sentences rendered in criminal actions to attack the validity of their convictions by post conviction procedures; however, we HOLD that the same rights must be afforded juvenile delinquents where committed for a violation of the penal code in order to comply with the equal protection clause of the Fourteenth Amendment to the Constitution of the United States.
The Clerk of this Court is directed to transmit a copy of this Order to Judge E.M. McDanel, Cleveland County Courthouse, Norman, Oklahoma; R.H. Doyle, Superintendent of the Boley State School for Boys; Mr. John Dratz, Juvenile Court Public Defender, Tulsa, Oklahoma; and Mr. John Lee Ritter, Consultant for the Department of Institutions, Social and Rehabilitative Services.
IT IS SO ORDERED.
WITNESS OUR HANDS, and the Seal of this Court, this 26th day of August, 1976.
                   TOM BRETT, P.J.
                   HEZ J. BUSSEY, J.
                   C.F. BLISS, JR., J.
