
410 P.2d 951 (1966)
75 N.M. 730
Phil CARTER, Superintendent of the Los Lunas Hospital and Training School, and Board of Directors of the Los Lunas Hospital and Training School, Mrs. A.F. Crosby, MRS. E.L. Kemp, Joseph C. Ryan, William Hoagland and Bennie Sanchez, Relators,
v.
Judge Samuel Z. MONTOYA, Juvenile Court Judge, First Judicial District, Santa Fe County, Respondent.
No. 8045.
Supreme Court of New Mexico.
February 7, 1966.
Boston E. Witt, Atty. Gen., Gary O'Dowd, Asst. Atty. Gen., Santa Fe, for relators.
Alfonso G. Sanchez, Dist. Atty., Norman M. Neel, Joseph F. Baca, Asst. Dist. Attys., *952 Santa Fe, Dean S. Zinn, Santa Fe, for respondent.
COMPTON, Justice.
This is an original proceeding in which we issued an alternative writ prohibiting the respondent from proceeding in a contempt action instituted by the district attorney against the relators for their alleged wilful refusal to obey respondent's order to admit a juvenile to the Los Lunas Hospital and Training School.
The order committing the juvenile was dated November 16, 1965. The relators' refusal to admit the juvenile at the time was the lack of available accommodations. The Board, under date of November 16, 1965, acting through its superintendent, explained its action by letter, as follows:
  "Honorable Samuel Z. Montoya
   District Judge
   First Judicial District
   County Court House        Re: Frankie Trujillo
   Santa Fe, New Mexico            J-1636
   Dear Judge Montoya:
In response to the commitment of Frankie Trujillo to Los Lunas Hospital and Training School, I am in agreement that the child is a problem and that his degree of mental retardation qualifies him for admission to this institution. However, our Point Priority Scale for admission does give consideration to applicants who are a social menace and even with the points allowed for such situations, we have two boys on the waiting list who have priority for admission over Frankie Trujillo as well as three with the same number of points. The cottage for this boy's age group is filled to capacity.
Accordingly, upon instructions from my Board of Directors, I must refuse him admission and return him to your court.
                                Respectfully yours,
                                s/ Phil Carter
                                   Phil Carter
                                   Superintendent"
Did the court have the power to force the relators to receive the juvenile under the foregoing conditions? Manifestly, we must look to the statutes for an answer. The pertinent provisions of the statutes upon which relators rely read:
Section 34-3-5, subd. E, N.M.S.A., 1953 Comp. (Supp. 1965):
"E. The board of directors shall admit to the institution persons who are properly committed to it by the courts and to the extent that accommodations are available. The superintendent of the institution may refuse admission to persons ordered committed to the institution upon certification in writing by him to the committing court that facilities are not available in the institution to adequately care or properly maintain such person. The superintendent shall give priority to the admission of any person to the institution when it is determined by the committing court that failure to do so will result in extreme hardship to the parents or guardian of the person or that the individual is a social menace to the community." Laws of 1963, ch. 293, § 1. (Emphasis added.)
*953 Section 34-3-6, subd. C, N.M.S.A., 1953 Comp. (Supp. 1965):
"C. Before such mentally defective person is transported to said institution, the court shall inquire of the superintendent thereof whether accommodations can be had for such mental defective person, and if he be informed there cannot, then the name of the mental defective shall be placed on the waiting list by the superintendent until such time as accommodations can be furnished for such person, notice of which shall forthwith be communicated to such court." Laws of 1963, ch. 293, § 2. (Emphasis added.)
Section 34-3-6.2, subd. C, N.M.S.A., 1953 Comp. (Supp. 1965):
"* * * the trial court shall secure written confirmation of the superintendent in all cases of regular or temporary commitment of individuals to the institution, indicating that adequate space and care is available to provide proper treatment and facilities for such person." Laws of 1963, ch. 293, § 4. (Emphasis added.)
On the other hand respondent points to the following statute as providing a basis for the position taken by him. The statute, in part, reads:
Section 13-8-53, N.M.S.A., 1953 Comp. (Supp. 1965):
"When any juvenile has been found to be within the provisions of the Juvenile Code [13-8-19 to 13-8-73] of New Mexico, the judge may issue an order to commit such juvenile:
"* * *
"C. To the Los Lunas Hospital and Training School or the New Mexico Insane Asylum, in the event the juvenile court determines that the juvenile is in need of treatment of the type afforded by those institutions;" Laws of 1965, ch. 233, § 3.
It is respondent's position that the latter section grants to juvenile courts the power to commit juveniles to the institution regardless of available accommodations. We disagree; while all the statutes with which we are here concerned were enacted in 1965, it makes no difference in this situation which became law first, because, being in pari materia, it is apparent to us that they were actuated by the same policy and must be read together. Manilla Community School District etc., v. Halverson, 251 Iowa 496, 101 N.W.2d 705. When we do so, we are forced to the conclusion that availability of accommodations is made the controlling factor in determining admissions, and this question rests solely with the relators and not with the court. That the court may punish for contempt is not open to question, § 13-8-67, N.M.S.A., 1953 Comp. (Supp. 1965), but, in view of what is later said, he is without authority to proceed further against the relators.
The respondent further argues that since relators have a plain, speedy and adequate remedy at law, prohibition does not lie. This general rule is universal and needs no citation of authorities, but there are exceptions as where the court is acting in excess of its jurisdiction. It is clear that the court went beyond its legitimate powers and thereby exceeded its jurisdiction. The order being a complete nullity, prohibition is proper. State ex rel. State Corp. Commission v. Zinn, 72 N.M. 29, 380 P.2d 182; State ex rel. De Moss v. District Court of the Sixth Judicial Dist., 55 N.M. 135, 227 P.2d 937; State Game Commission v. Tackett, 71 N.M. 400, 379 P.2d 54. Compare The Macabees v. Chavez, 43 N.M. 329, 93 P.2d 990. Other questions urged by respondent have been noticed and are also found without merit.
The writ should be made absolute, and it is so ordered.
CARMODY, C.J., and CHAVEZ, NOBLE, and MOISE, JJ., concur.
