delivered the opinion of the Court.
When petitioner was 16 years and 9 months old he was sentenced by the Minors’ Guardianship Court for committing burglary. The judgment provided that said minor would remain in the custody of his parents on condition that if he violated the terms and conditions thereof he would be committed to the Industrial School of Mayagiiez.
On September 29, 1960, when petitioner was already about 20 years of age, he was charged with a violation of the *469Drugs Act and tried before the Superior Court, Caguas Part, where he was sentenced by Judge Villares to serve from six to twelve years’ imprisonment in the penitentiary.1
In August 1961 defendant filed in his own right a petition for habeas corpus before the same court which had sentenced him, alleging that the judgment had been rendered without jurisdiction because, since defendant was under the jurisdiction of the Minors’ Guardianship Court, that court had not waived jurisdiction.
The writ was issued and the hearing of the petition was held without petitioner being represented by counsel. The evidence having been heard, the court denied the petition.
Petitioner alleges before this' Court that the Superior Court erred (1) in holding that under the provision of § 3 of Act No. 97 of 1955 petitioner could be prosecuted as an adult without the Minors’ Court waiving its authority; (2) in failing to designate an attorney for the hearing of the petition for habeas corpus; (3) in failing to decide the petition within a reasonable term; and (4) that the same judge who presided at the criminal cause against him presided at the hearing of the petition.
No error was committed to warrant reversal of the judgment appealed from.
Act No. 97 of 1955, which took effect on September 21 of that year, provides in § 3 (34 L.P.R.A. § 2003) that the Court (Minors’ Court) “shall retain its authority over any child covered by the provisions of sections 2001-2015 of this title until he attains 21 years of age, unless said Court shall, upon order to that effect, waive its authority over the minor after reaching 16 years and before attaining 21 years of age; Provided, however, that a minor who, having reached 18 years of age, commits another violation of law while under the supervision of the Court, shall be prosecuted as an adult.”
*470Therefore, if the minor under the supervision of the Minors’ Court has attained 18 years of age and commits another violation of law, he shall be prosecuted as an adult without it being necessary for the Minors’ Court to waive its authority over the minor.2 Such waiver is necessary whenever the minor is over 16 and under 18 years of age.3
Relying on People v. Andújar, 80 P.R.R. 792 (1958), appellant contends, however, that § 3 supra of Act No. 97 of 1955 “is not applicable to a minor who at the time of the commission of the offense charged was already under the authority of the Minors’ Court and to the provisions of Act No. 37 of 1915, since that section, which is ex post facto when applied to the minor, would be detrimental and alter unfavorably his situation as respects the alleged offense and its consequences.”
This question was already decided against appellant in González v. Delgado, Warden, 82 P.R.R. 471 (1961), where we distinguished that of Andújar. The distinction consisted in that, while the violation imputed to Andújar was committed before Act No. 97 of 1955 took effect, González committed the offenses for which he was prosecuted as an adult at a time subsequent to said effective date. The same situation was present in the case of appellant herein. In passing upon the issue of the ex post facto application of the law, in Gonzalez we said at pp. 473 and 474: “Assuming that the guarantee against the ex post facto application of an Act applies to statutes like the one we are considering, it *471cannot be held that it is intended to apply a different punitive measure to acts already consummated. It is not that Act No. 97 aggravates the petitioner’s situation in relation to the crimes charged and their consequences. Act No. 97 was applied simply because it was the one in effect when the violation of the law was perpetrated.”
The lack of legal assistance at the hearing of a petition for habeas corpus where petitioner by reason of indigence is unable to hire the services of an attorney to assist him at the hearing, may constitute in some instances a denial of his right to have the court pass- upon the legality of his imprisonment. In Capeles v. Delgado, Warden, 83 P.R.R. 668 (1961), we already said that where a petition for habeas corpus presents a controversy of facts subject to the hearing of evidence, the best practice is to designate an attorney to represent defendant. However, and for the reasons which follow, the fact that petitioner herein was not assisted by counsel at the hearing of the petition for habeas corpus does not constitute an error warranting reversal of the judgment.
As has been seen, in that petition petitioner assailed the validity of the sentence of imprisonment in the penitentiary which he is serving on the ground that the Superior Court lacked jurisdiction to prosecute him as an adult, alleging that petitioner was under the jurisdiction of the Minors’ Guardianship Court. The presentation of evidence to establish the pertinent facts was necessary. Petitioner, his mother, and the person in charge of the Juvenile Home testified at the hearing. The presiding judge examined these witnesses. The questions were aimed at establishing with the answers the basic facts alleged by petitioner. At the close of this evidence the judge ordered the district attorney to make an investigation of the facts in order to determine, among others, whether the Minors’ Guardianship Court had waived its authority over petitioner. At a subsequent hearing the dis*472trict attorney produced the record of petitioner in the Minors’ Guardianship Court containing the information necessary to decide the question raised in the petition for habeas corpus. All the pertinent facts being known and on which there was no controversy, the judge proceeded to pass upon the legal question which is the same we have just decided in considering the first error assigned by the attorney designated by this Court to represent appellant in this appeal.
No practical purpose would be accomplished by reversing the judgment and remanding the case for further hearing of the same evidence before the Superior Court, at which petitioner shall be assisted by counsel.
What we have said is likewise applicable to the error assigned regarding the trial court’s delay in passing upon the petition.
Finally, in our opinion appellant did not suffer any prejudice by the fact that the judge who presided at the criminal trial was the same one who took cognizance of the petition for habeas corpus.
The lack of jurisdiction of the Superior Court to prosecute petitioner as an adult was raised for the first time in the petition for habeas corpus. There was no legal impediment precluding Judge Villares from passing upon that question. Had it been raised in the criminal prosecution, it would have been that magistrate’s duty to pass upon the same.
The judgment appealed from will be affirmed.
The offense was committed when defendant was over 18 years of age.
There was some inconsistency in the Act which was corrected by means of the 'provided clause of § 3 of Act No. 97 of 1955. Minors between the ages of 18 and 21 who had never committed an offense were treated as adults, while those between those ages who were under the jurisdiction of the Juvenile Court were treated as minors until they attained age 21. See footnote 2 of González v. Delgado, Warden, 82 P.R.R. 471 (1961).
We are not considering the situation provided in § 4 of the Act concerning the change of venue from the Minors’ Court to the Superior Court in the case of a minor over 16 and under 18 years of age charged with a felony to be dealt with as an adult.