
227 Cal.App.3d 1223 (1991)
278 Cal. Rptr. 391
THE PEOPLE, Plaintiff and Respondent,
v.
MICHAEL HARRIS, Defendant and Appellant.
Docket No. B044048.
Court of Appeals of California, Second District, Division Five.
February 21, 1991.
*1224 COUNSEL
Corinne S. Shulman, under appointment by the Court of Appeal, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, Richard B. Iglehart, Chief Assistant Attorney General, Edward T. Fogel, Assistant Attorney General, Carol Wendelin Pollack and Elaine F. Tumonis, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
ASHBY, J.
By nonjury trial appellant Michael Harris was found guilty as charged of first degree deliberate and premeditated murder, with the special circumstance that the murder was committed while in lying in wait and the further finding that appellant personally used a firearm in commission of the offense. (Pen. Code, §§ 187, 190.2, subd. (a)(15), 12022.5.)
Thereafter the trial court received extensive evidence and conducted several hearings on the issue whether the court should exercise its power under *1225 Penal Code section 1385 and People v. Williams (1981) 30 Cal.3d 470, 489-490 [179 Cal. Rptr. 443, 637 P.2d 1029], to dismiss the special circumstance finding in order to impose a sentence of 27 years to life rather than life imprisonment without possibility of parole.
At the conclusion of the hearings the trial court inquired whether appellant would be willing to waive credit for time already spent in custody, to which appellant's counsel replied yes. The court thereupon announced "the motion is granted, defendant having waived his back time. You are sentenced to state prison for 25 years to life plus 2 years for the use of a firearm. Twenty-seven years to life."
The judgment imposes a sentence of 27 years to life with no credit for custody or conduct. Neither the judgment nor the court's minute order gives reasons for the trial court's action, except to state "court grants defendant's `Williams motion'."[1]
Appellant appeals, contending that he did not knowingly and intelligently waive credit for time served and should be awarded such credit. The People in the capacity of respondent raise the issue that the trial court failed to comply with the requirement of Penal Code section 1385 that the court's reasons for dismissal of the special circumstance finding be stated in the minutes.
We reverse and remand for a new sentencing hearing. The issue raised by appellant on his appeal requires that the parties be restored to the status quo ante with the special circumstance finding reinstated. If the trial court elects to dismiss the special circumstance finding on condition that appellant waive custody and conduct credit, the court must obtain a knowing and intelligent waiver from appellant and enter in the minutes an adequate statement of reasons to justify dismissing the special circumstance finding.

FACTS
Because the only issue involves the sentence and waiver of custody credit, the facts of the underlying murder may be stated briefly. About seven months before the murder, the victim, Kenneth Fulcher, and appellant had a fistfight in front of appellant's girlfriend, and Fulcher knocked appellant out. Appellant became obsessed with the incident and he determined to confront Fulcher.
*1226 About three weeks before the murder appellant went to San Francisco and purchased a handgun, using a falsified driver's license. In the early morning hours of February 26, 1986, appellant fashioned a mask from a piece of thermal underwear, took a large cardboard box into Fulcher's garage and hid in the box for two hours waiting for Fulcher. When Fulcher entered the garage, appellant exchanged words and pushes with him, then shot Fulcher six times, killing him.
Appellant presented a psychiatric defense that he suffered from a severe personality disorder including narcissistic, borderline, schizotypical and dependent characteristics, not amounting to a psychosis, aggravated by appellant's use of alcohol and a prescription drug, Ritalin, on the day of murder.
The court found the murder was deliberate and premeditated, was not diminished by appellant's mental condition, and was committed while lying in wait.
The court then raised the issue of mitigating the punishment as to the special circumstance finding. Both parties submitted points and authorities. The court received extensive additional evidence, including the probation officer's report, appellant's prior convictions of vehicular manslaughter and grand theft, an additional psychiatric report, a private criminological study of appellant, letters from appellant, friends and relatives, and live testimony.
At the July 28, 1989, hearing the trial court commented "this is the closest call I've ever had to make." The court put the matter over to August 1. After very brief argument from counsel on August 1 concerning the Governor's power to commute a sentence of life imprisonment without possibility of parole, the following occurred:
"THE COURT: I would like to inquire if the defendant would be willing to waive his back time.
"[DEFENSE COUNSEL]: Yes, Your Honor.
"THE COURT: Do you want to speak to your client?
"[DEFENSE COUNSEL]: Yes, Your Honor.
"THE COURT: The motion is granted, defendant having waived his back time. You are sentenced to state prison for 25 years to life plus two years for the use of a firearm. 27 years to life.
*1227 "[DEFENSE COUNSEL]: Thank you, Your Honor.
"THE DEFENDANT: Thank you, Your Honor.
"THE COURT: And there will be no credits [in that] this was a contested issue."

DISCUSSION
(1a) Appellant contends the record does not show that he intelligently and knowingly waived custody and behavior credit amounting to 1,519 days, more than 4 years. A defendant may waive custody credit in order to receive other sentencing considerations, if the waiver is knowing and intelligent. (People v. Johnson (1978) 82 Cal. App.3d 183, 188 [147 Cal. Rptr. 55]; People v. Zuniga (1980) 108 Cal. App.3d 739, 742 [166 Cal. Rptr. 549].) Appellant points out that: (1) so far as the record shows, the court's inquiry was the first mention by anyone of waiving credit; (2) appellant was not advised on the record of the consequence of waiver nor the number of days involved; and (3) appellant was not personally questioned; only appellant's lawyer spoke.
The real issue is the proper disposition in these circumstances. Appellant contends we should modify the judgment to include the credits, then affirm the judgment as modified. We reject this contention. We conclude the proper procedure is to restore the parties to the status quo ante, as is done when a defendant's plea or admission must be reversed on appeal due to inadequate advisement of rights. (In re Sutherland (1972) 6 Cal.3d 666, 672 [100 Cal. Rptr. 129, 493 P.2d 857]; People v. Serrato (1973) 9 Cal.3d 753, 765 [109 Cal. Rptr. 65, 512 P.2d 289]; People v. Hickey (1980) 109 Cal. App.3d 426, 435 [167 Cal. Rptr. 256].)
Appellant attempts to avoid this analysis by claiming that the record does not show there was a "bargained" quid pro quo. The "bargain" aspect is not controlling. Although no bargain was expressly placed on the record, the court's remarks make clear that the court would not or might not have dismissed the special circumstance finding without appellant's waiver of credit.
We faced a very similar situation in People v. Meyers (1978) 77 Cal. App.3d 732 [143 Cal. Rptr. 686]. That case also involved a denial of custody credit in order to require the defendant to serve a longer period in custody as a condition of probation. The defendant likewise contended on appeal that "`there was not one word spoken to indicate that as part of the bargain he was not to receive credit for time served.'" (Id., at p. 737.) We *1228 held: "[n]evertheless, whatever the record may or may not indicate about the terms of the plea bargain, it convincingly demonstrates that the court intended that defendant be physically confined in jail for two years.... [¶] [I]t is clear that as far as the court was concerned, the condition of two years' actual custody was `the heart of the of the probation order; without it, the order would have been quite different or might not have been forthcoming at all.' [¶] Defendant cannot have it both ways. If he bargained away his rights to back time credit... and could legally do so, why is he here? If he did not  and we agree that on this record we cannot say that he did  the appeal has the effect of bringing an illegal sentence to our attention." (Id. at pp. 737-738, citations omitted.) Similarly, in People v. Hickey, supra, 109 Cal. App.3d at page 435, the appellant attempted carefully to sidestep contentions which would require restoring the status quo ante, but the appellate court stated "once [appellant] lays his cause at an appellate doorstep he subjects himself to thorough scrutiny of the proceedings below."
Appellant misplaces reliance on People v. Harris (1987) 195 Cal. App.3d 717 [240 Cal. Rptr. 891] for his argument that the judgment should be modified rather than reversed and remanded. In Harris the defendant waived credit in order to obtain probation, but the appellate court held the waiver did not extend to his state prison sentence upon revocation of probation in a subsequent proceeding. Here appellant is on direct appeal from the proceedings in which the waiver was given. No subsequent events have occurred to give appellant's waiver some significance other than apparent when the waiver was entered.
Appellant contends the People waived the right to object because the People failed to appeal the trial court's order. (See People v. Burke (1956) 47 Cal.2d 45, 53 [301 P.2d 241].) The waiver argument is not persuasive. The sentence imposed by the trial court may have been acceptable to the People when it excluded all custody and conduct credit. By the argument raised on appellant's appeal, appellant now seeks to reduce the sentence substantially.
(2) On remand the trial court must comply with Penal Code section 1385 if the court again elects to dismiss the special circumstance finding. The requirement of Penal Code section 1385 that the court's reasons for dismissal be entered in the minutes is mandatory.[2] The reason must be set forth "`"so that all may know why this great power was exercised."'" *1229 (People v. Rivadeneira (1985) 176 Cal. App.3d 132, 136-137 [222 Cal. Rptr. 548].) Section 1385 also requires that a dismissal under that section be in furtherance of justice, which requires consideration not only of the defendant's rights but also the interest of society as represented by the People. (People v. Orin (1975) 13 Cal.3d 937, 945 [120 Cal. Rptr. 65, 533 P.2d 193].) A statement of reasons is necessary to permit appellate review of the possible abuse of the trial court's discretion. (People v. Beasley (1970) 5 Cal. App.3d 617, 637 [85 Cal. Rptr. 501].)
(1b) The judgment of conviction is affirmed. The special circumstance finding is reinstated. The cause is remanded for the trial court to reconsider whether the special circumstance finding should be dismissed pursuant to Penal Code section 1385. If the trial court determines to dismiss the special circumstance finding on condition that appellant waive custody and conduct credit, the court shall obtain on the record an adequate waiver from appellant. If the court determines to dismiss the special circumstance finding, the court shall set forth in the minutes a statement of its reasons.
Turner, P.J., and Boren, J., concurred.
Appellant's petition for review by the Supreme Court was denied May 16, 1991.
NOTES
[1]  Although a dismissal under Penal Code section 1385 may be made only on motion of the prosecutor or the court's own motion (People v. Laiwa (1983) 34 Cal.3d 711, 722 [195 Cal. Rptr. 503, 669 P.2d 1278]), the trial court referred to this matter as appellant's Williams motion.
[2]  Penal Code section 1385, subdivision (a) provides: "The judge or magistrate may, either of his or her own motion or upon the application of the prosecuting attorney, and in furtherance of justice, order an action to be dismissed. The reasons for the dismissal must be set forth in an order entered upon the minutes. No dismissal shall be made for any cause which would be ground of demurrer to the accusatory pleading."
