
408 Mass. 527 (1990)
562 N.E.2d 465
IN THE MATTER OF VINCENT.
Supreme Judicial Court of Massachusetts, Suffolk.
September 7, 1990.
November 8, 1990.
Present: LIACOS, C.J., NOLAN, LYNCH, O'CONNOR, & GREANEY, JJ.
Carol A. Donovan, Committee for Public Counsel Services, for the child.
E. Michael Sloman, Special Assistant Attorney General, for Haverhill Division of the District Court Department.
Anthony S. DeMarco, for Children's Law Project, was present but did not argue.
James M. Shannon, Attorney General, & Judith Fabricant, Assistant Attorney General, for the Attorney General & others, amici curiae, submitted a brief.
NOLAN, J.
In this case, we are asked to determine the breadth of authority of a judge sitting in the juvenile session of a District Court when acting in the case of a child found to be in need of services under G.L.c. 119, §§ 39E-39J *528 (1988 ed.). Specifically, we are faced with the question whether a Juvenile Court judge may hold such a child in contempt of court for failure to comply with the court's order.
The child was first introduced to the judicial system on May 2, 1989, when he was determined to be a "child in need of services" (CHINS) under G.L.c. 119, § 39E, for his wilful and persistent failure to attend school.[1] The child, although described as "extremely bright," tended to stay up late at night and to sleep during school hours. The District Court judge, sitting in the juvenile session, imposed the following order on the child: that he attend school every day; that he report to a probation officer twice a week; that he attend family counseling; and that he abide by a 7:30 P.M. curfew. On issuing this order, the judge warned the child that, if he failed to obey, he would be sent to the Department of Youth Services (DYS).
On October 10, 1989, the child appeared in court once again,[2] this time at the instigation of the probation officer, who reported that the child had not been attending school. The judge once again ordered the child to go to school, set a 9 P.M. bedtime, prohibited the child from watching television, and threatened him with commitment to DYS. A petition for contempt of court was filed on that date.
The hearing on the petition for contempt took place on October 31, 1989. The probation officer testified that the child *529 had missed four days of school since October 10, 1989, and had missed one of two or three previous appointments with the Department of Social Services (DSS) counselor. The probation officer also stated that the child had complied with all other aspects of the order and had a "good attitude" toward her. The judge found the child in contempt of court for failure to comply fully with his order, and continued the case to December 19, 1989, for disposition.
Between October 31 and December, 1989, the child continued to meet with his probation officer, complied with the court-ordered curfew and bedtime restriction and attended meetings with the social worker. According to a report filed by his social worker, "[s]chool attendance still is the major issue in this case." The social worker concurred with the recommendation of home-based education which had been made by Dr. Jonathan Miller, the psychologist to whom the child had been referred by DSS.[3] Dr. Miller, who filed his report on December 18, 1989, had been treating the child and the mother since May of 1989. The social worker then referred the child to Dr. J.C. Michael Shea, a physician with the North Essex Community Mental Health Centers, for evaluation as to appropriateness of home-based education.
Dr. Shea filed his report on January 4, 1990. He strongly advised against committing the child to DYS.[4] Dr. Shea stated that the child's failure to attend school could be related to depression. He specifically noted that, since DYS has no schooling, a commitment would defeat the whole purpose of the judge's order. In short, Dr. Shea recommended home education for the remainder of the school year.
On January 9, 1990, the child appeared before another District Court judge on the disposition for contempt. At that *530 time, a representative from DSS informed the judge that DSS was arranging home tutoring and recommended that the child not be removed from his mother. The case was continued for one month.
On January 30, 1990, DSS informed the judge that the child had complied with all of the other orders given but was still not attending school. DSS also told the judge of the opinions of Drs. Shea and Miller and stated that it was arranging for home-based education. The DSS representative also informed the judge that the reason the child was not attending school was due to an emotional problem or mental block. The judge then sentenced the child to DYS for thirty days, or to be released as soon as he signed an agreement promising that he would attend school.
On January 31, 1990, a single justice of this court stayed the commitment until February 8, 1990. On February 7, 1990, another single justice continued the stay until further order of the court. On May 30, 1990, the single justice reserved and reported to the full court the following questions for determination:
"1. May the juvenile session of the district court department, acting in the case of a child found to be in need of services pursuant to G.L.c. 119, §§ 39E-J, adjudge the child in contempt of court for failure to comply with its orders and commit the child to the Department of Youth Services?
"2. If the answer to question number 1 is `yes,' did the juvenile session of the District Court properly adjudge the child in the instant case to be in contempt of court?"
It is well settled that a court has the inherent power to impose sanctions for contempt of its orders. Doe v. Commonwealth, 396 Mass. 421, 422 (1985). However, that principle assumes the validity of the underlying order. Therefore, the threshold question is whether the Juvenile Court judge's order that the child attend school was valid. The child contends that the order was an injunction issued directly against the child and therefore unauthorized under G.L.c. 119, § 39G. He further maintains that the only orders authorized by the *531 statute are orders as to custody. In addition, the child contends, the judge may make such orders subject to conditions and limitations such as attendance at school. We agree.
We determine that the judge's order was a direct order to the child to attend school which was invalid under c. 119, § 39G. The order was invalid because it was not an order of disposition on which custody was conditioned as authorized by the statute. Section 39G, reads in pertinent part: "Upon making [the adjudication that a child is in need of services, the court] ... may make any of the following orders of disposition: (a) subject to any conditions and limitations the court may prescribe, including provision for medical ... educational ... services, permit the child to remain with his parents" (emphasis added).[5] Under the statute, a judge may permit a child to stay in parental custody, subject to certain limitations prescribed by the court, such as school attendance. In addition, the CHINS statute authorizes the judge to order that the child be placed in the custody of certain enumerated individuals, subject to conditions, as well as in the custody of the DSS.
Nowhere does the statute authorize a judge directly to order a child to attend school or to abide by other conditions *532 the judge imposes except as a condition of custody. In this case, the judge did not make the orders for school attendance, curfew, and counseling, conditions of allowing the child to stay in the custody of his mother as required under the statute. The judge's order was a direct order, not a condition of custody, and thus was invalid.[6] Since the underlying order was invalid, any use of the contempt power for failure to obey the order was therefore unwarranted.
As to reported question number one, our answer is limited to the situation discussed above, where a judge issues an "attend school" order. Given this qualification, we answer the question, "No." We do not reach question number two. The case is remanded to the Supreme Judicial Court for the county of Suffolk where an order shall enter setting aside the order that held the child in contempt and committed him to the Department of Youth Services for thirty days.
So ordered.
NOTES
[1]  The child, born November 29, 1974, was in the ninth grade at the time of his initial court appearance on May 2, 1989. On that date, the attendance officer for the Haverhill public schools testified that the child had missed ninety-two of the previous 146 days of school.

Chapter 119, § 21, defines a "[c]hild in need of services" as "a child below the age of seventeen who persistently runs away from the home of his parents or legal guardian, or persistently refuses to obey the lawful and reasonable commands of his parents or legal guardian, thereby resulting in said parent's or legal guardian's inability to adequately care for and protect said child, or a child between the ages of six and sixteen who persistently and wilfully fails to attend school or persistently violates the lawful and reasonable regulations of his school" (emphasis added).
[2]  The child had appeared in court on June 20, 1989, and was excused from reporting to the probation officer during the summer months.
[3]  According to Dr. Miller's report of December 18, 1989, the child attributed his failure to attend school to "stomach problems" and "sleep disturbance."
[4]  Dr. Shea stated in his January 4, 1990, report that, "[s]ince this child has no history of criminal behavior except school delinquency, putting him in the custody of DYS and exposing him to the anti-social, criminal element there would be cruel and unusual punishment, i.e. hazing. Why?"
[5]  General Laws c. 119, § 39G, provides that, on making a determination that a child is in need of services, "the court, taking into consideration the physical and emotional welfare of the child, may make any of the following orders of disposition:

"(a) subject to any conditions and limitations the court may prescribe, including provision for medical, psychological, psychiatric, educational, occupational and social services, and for supervision by a court clinic or by any public or private organization providing counseling or guidance services, permit the child to remain with his parents;
"(b) subject to such conditions and limitations as the court may prescribe, but not limited to provisions for those services described in clause (a), place the child in the care of any of the following: (1) a relative, probation officer, or other adult individual who ... is found to be qualified to receive and care for the child; (2) a private charitable or childcare agency or other private organization, licensed or otherwise authorized by law to receive and provide care for the child; ...
"(c) subject to the provisions of sections thirty-two and thirty-three and subject, further, to such conditions and limitations as the court may prescribe, commit the child to the department of social services...."
[6]  On the child's first appearance in court, the judge issued the following orders:

"Now the days of doing what you please are over, as of today. You will obey your mother and you will obey me. If you do not, this will happen - number one, I may decide to send to DYS, for a while to think about it until you obey."
The child again appeared in court on October 10, 1989, the judge issued the following orders:
"Now orders are orders, you either follow them or you'll go to a place where you won't have the opportunity to sleep late. You'll get up at 6 o'clock in the morning. Now you're gonna be specifically ordered by me again - once again - and that's, that's it. As a matter of fact, I think you should file a petition for contempt, and having a hearing on it two or three weeks from now and maybe you'll spend a little time at the Department of Youth Services. That ought to stimulate your thinking, make you understand that the court orders are to be obeyed, not just doing anything you please. OK. Continue the matter for two weeks, we'll have a hearing on it for contempt. Now in the meantime, no TV, no TV at night and you'll go to school every morning.... Go to bed at 9 o'clock. Every night, you go to school every day, or else you're gonna land at DYS. There's gonna be a petition served on you for violating the terms of my order. A petition for contempt. Mr. Seabrook will represent you, and after that there will be a hearing two weeks from today and if it's found that you are in contempt  you will be sent away." (Emphasis added.)
