
200 Cal.App.3d 505 (1988)
246 Cal. Rptr. 150
LOS ANGELES COUNTY DEPARTMENT OF CHILDREN'S SERVICES, Petitioner,
v.
THE SUPERIOR COURT OF LOS ANGELES COUNTY, Respondent; JORGE N., a Minor, et al., Real Parties in Interest.
Docket No. B033347.
Court of Appeals of California, Second District, Division Two.
April 19, 1988.
*506 COUNSEL
De Witt W. Clinton, County Counsel, Sterling Honea, Joe Ben Hudgens and Roger H. Grambo, Deputy County Counsel, for Petitioner.
Dennis A. Fischer for Respondent.
Steven P. Beltran, Emma Castro, Goldberg, Fuchs & Castro, Thomas G. Greene and Theodore S. Goodwin for Real Parties in Interest.
*507 OPINION
THE COURT.[*]
(1) (See fn. 1.) In this mandamus proceeding, the Los Angeles County Department of Children's Services challenges an order of the superior court releasing a minor child to the custody of his parents.[1]
The minor, Jorge, was born Monday, February 29, 1988. His three older sisters, ages seven, six, and one, who had three different fathers, had earlier been adjudged dependent children of the juvenile court and removed from the mother's physical custody due to reported neglect and abuse by her and two of the fathers, one of whom was also Jorge's father. After receiving a report that Jorge's blood contained cocaine at the time of his birth, the department of children's services took custody of him at 9 a.m. on Thursday, March 3, and placed him in a foster home.
When a minor child is thus taken into custody, a petition to declare him a dependent child of the juvenile court (Welf. & Inst. Code, § 300) must be filed immediately once the officer decides not to release him. (Welf. & Inst. Code, § 311, subd. (a); Cal. Rules of Court, rule 1331(c).)[2] Upon the filing of the petition, the superior court will hold a detention hearing almost immediately to determine whether the minor should be further detained pending the "jurisdiction hearing." (§ 315; rule 1331(e).) The jurisdiction hearing must be held within 15 judicial days if the minor is detained pending the hearing, and otherwise within 30 calendar days. (§ 334; rule 1361(a), (b).) At the jurisdiction hearing the court decides whether to adjudge the minor a dependent child of the juvenile court. (§ 356; rules 1364, 1365.)
(2) The minor cannot lawfully be held more than 48 hours, excluding nonjudicial days, without a petition having been filed. (§ 313, subd. (a); rule 1331(a).)[3] In Jorge's case, 48 hours expired at 9 a.m. on Saturday, March 5, so the deadline imposed by this provision extended until Monday, March 7. *508 The department of children's services missed the deadline, however, and filed its petition on Tuesday, March 8.[4]
At the time scheduled for the detention hearing on March 8, the court ordered Jorge released to his parents because the petition had not been filed the previous day. It declined to receive evidence or argument on the issues raised by a detention hearing  generally whether Jorge's physical well-being was in substantial danger and there was no reasonable means to protect him without removing him from his parents' physical custody. (§ 319; see rule 1337.) On March 10, the court denied the department's motion for reconsideration. This petition followed. On March 17 we stayed the trial court's order.
The trial court considered its order mandated by section 313, which says "such minor shall be released within 48 hours ... unless within said period of time a petition ... has been filed...." This interpretation was incorrect. Section 313 governs the situation in which the minor has been detained over 48 hours and no petition has been filed. Under such circumstances, by hypothesis, no court case is pending. The command of the statute is, therefore, directed not to a judicial officer, but only to the officer or agency maintaining temporary nonjudicial detention of the minor. If no petition has been filed, the agency is required to release the minor after 48 hours. That command can be enforced by habeas corpus or other appropriate judicial remedy.
Section 313 does not, however, prohibit continued detention of a minor after a petition has been filed. In particular, it does not say a detention hearing cannot be held if the minor was kept in custody over 48 hours before the petition was filed. Once the petition is filed, the controlling statute is section 315, which provides: "If a minor has been taken into custody under this article and not released to a parent or guardian, the juvenile court shall hold a hearing (which shall be referred to as a `detention hearing') to determine whether the minor shall be further detained. This hearing shall be held as soon as possible, but in any event before the expiration of the next judicial day after a petition to declare the minor a dependent child has been filed. If the hearing is not held within the period prescribed by this section, the minor shall be released from custody." (See also rule 1331(e).) This provision, unlike section 313, is directed to the juvenile court.[5] It requires, in mandatory language, the holding of a *509 detention hearing. By declining to hold the detention hearing, the trial court implicitly ruled that section 313 takes precedence over section 315 and requires, when the 48-hour limit is violated, forfeiture of the opportunity for a detention hearing.
(3) Our construction of these statutes is consistent with the purpose of the Juvenile Court Law to protect minors. In the instant case, as a result of one day of unlawful detention, the trial court ruled Jorge must remain in the physical custody of his parents for a month until the jurisdiction hearing.[6] This was the least appropriate remedy for the department's violation of section 313: punishing the minor by depriving him of the opportunity for judicial protection of his safety and health.[7] The provisions of the Juvenile Court Law were not written to provide the rulebook for a new game of tactics and sanctions. The trial court seemingly assumed that detention pending the jurisdiction hearing is a combat pitting the department, on the one side, against the parents and the minor, on the other. Detention is against the wishes of the parents, but it cannot be assumed to be adverse to the interests of the newborn.[8] It was error to "reward" Jorge with release from custody and thus "save" him from facing a statutory detention hearing. The court should have held the detention hearing immediately, as required by section 315.
Because the passage of time makes issuance of a writ unnecessary, the petition for writ of mandate is dismissed as moot.
Compton, Acting P.J., Gates, J., and Fukuto, J., concurred.
A petition for a rehearing was denied May 11, 1988, and the petition of all real parties in interest for review by the Supreme Court was denied July 13, 1988.
NOTES
[*]   Before Compton, Acting P.J., Gates, J., and Fukuto, J.
[1]  As in so many juvenile dependency cases, this one was mooted by subsequent trial court rulings during the pendency of appellate proceedings. Because it presents a significant and recurring issue, however, the petition will be considered on its merits. (See In re William M. (1970) 3 Cal.3d 16, 23-25 [89 Cal. Rptr. 33, 473 P.2d 737].)
[2]  Unless otherwise indicated, all subsequent statutory references are to the Welfare and Institutions Code.
[3]  Section 313, subdivision (a) reads: "Whenever a minor is taken into custody by a peace officer or probation officer ... such minor shall be released within 48 hours after having been taken into custody, excluding nonjudicial days, unless within said period of time a petition to declare him a dependent child has been filed pursuant to the provisions of this chapter."
[4]  It is thus unnecessary to decide whether the petition should have been filed at the opening of court, or by 9 a.m., or by the end of the court day on Monday, March 8. (Cf. In re Robin M. (1978) 21 Cal.3d 337, 340 fn. 4, 343 fn. 11 [146 Cal. Rptr. 352, 579 P.2d 1].)
[5]  To read rule 1331(a), which restates section 313, as impliedly directed to the court because it is part of the Juvenile Court Rules, is thus inconsistent with the statutory scheme.
[6]  The trial court's order for Jorge's release also restrained the department from redetaining him, absent demonstrably changed circumstances.
[7]  Likewise, it was not the proper sanction to be imposed against the department for its dereliction in filing the petition late.
[8]  For this reason the trial court's action was not required by In re Robin M., supra, 21 Cal.3d 337, 343, fn. 11 (involving a 16-year-old detained under section 625 for allegedly committing seven robberies) wherein is found a dictum that the minor, because in custody beyond the 48-hour limit, should have been released at the detention hearing.
