
457 N.W.2d 211 (1990)
STATE of Minnesota, Respondent,
v.
Stephen Thomas BONAFIDE, Appellant.
No. C2-90-583.
Court of Appeals of Minnesota.
June 5, 1990.
Hubert H. Humphrey, III, Atty. Gen., St. Paul, Julius E. Gernes, Winona County Atty., Timothy J. Guth, Asst. County Atty., Winona, for respondent.
John M. Stuart, State Public Defender, Mark F. Anderson, Asst. State Public Defender, Minneapolis, for appellant.
Considered and decided by LANSING, P.J., and FORSBERG and SCHULTZ,[*] JJ.

OPINION
LANSING, Judge.
This appeal raises the issue of whether the sentencing court must allow credit against sentence for time spent in a security hospital under a civil commitment order that originated during the pendency of the criminal proceeding. We hold that the time must be automatically deducted from the sentence because it is custodial time connected to the offense or behavioral incident for which sentence was imposed. Reversed and remanded for resentencing.

FACTS
Stephen Bonafide was arrested and taken into custody in October, 1988. While in *212 custody and during the pendency of the charges, the criminal proceedings were suspended to determine Bonafide's competence to proceed. See Minn.R.Crim.P. 20.01.
Based on a medical evaluation the trial court determined that Bonafide was not competent and he was referred to the county department of social services for commencement of civil commitment proceedings. In April, 1989 Bonafide was transferred under a civil commitment order to St. Peter Security Hospital.
In July, 1989 the director of St. Peter Security Hospital notified the Winona County Sheriff's Department that Bonafide was no longer mentally ill and dangerous and Bonafide was returned to their custody. The trial court determined that Bonafide was competent to proceed and ordered the proceedings resumed in July, 1989.
In September, 1989 Bonafide pleaded guilty to attempted second degree assault. Bonafide was sentenced to 29 months imprisonment and received credit against the sentence for the 180 days between arrest and commitment, and for the 95 days after his release from St. Peter through the date of sentencing. The trial court did not allow credit for Bonafide's time in St. Peter for treatment under the civil commitment order. After incarceration Bonafide brought a motion requesting credit against his sentence for the 68 days spent at St. Peter. He appeals the trial court's denial of the motion.

ISSUE
Is appellant entitled to credit against his prison sentence for time spent at St. Peter Security Hospital under a civil commitment order issued after criminal proceedings were suspended due to appellant's incompetence to proceed to trial?

ANALYSIS
At imposition of sentence a court is required to automatically deduct from the sentence all time spent in custody in connection with the offense or behavioral incident. See Minn.R.Crim.P. 27.03, subd. 4(B). A related precept of our criminal rules is that a person may not be "tried or sentenced for any offense while mentally ill or mentally deficient so as to be incapable of understanding the proceedings or participating in his defense." Minn.R.Crim.P. 20.01, subd. 1. Bonafide requested credit for his presentence commitment under both Rules 20.01 and 27.03 and we consider them in turn.

Rule 20.01 Determination of Competency
In order to insure that a defendant is competent to understand and participate in criminal proceedings, the rules provide a medical examination procedure when competency is in doubt. Minn.R.Crim.P. 20.01, subd. 2. If the court determines the defendant is not competent, the criminal proceedings are suspended, and civil commitment proceedings are instituted. Minn.R.Crim.P. 20.01, subd. 4. The civil commitment proceeding is separate from the criminal proceeding. See Minn.R.Crim.P. 20.01, subd. 4(2), Minn.Stat. Chap. 253B. If the proceeding results in commitment, the institution's director is required to keep the trial court apprised of defendant's condition. When the defendant becomes competent to proceed, the criminal proceedings are resumed. Minn.R.Crim.P. 20.01, subd. 5.
If, after resuming the criminal proceedings, defendant is convicted of the charge:
* * * the time he has spent confined to a hospital or other facility under this rule shall be credited upon any jail or prison sentence imposed upon him.
Rule 20.01, subd. 9, Minn.R.Crim.P. Bonafide interprets this provision as plainly requiring that he be given credit for the time spent at St. Peter under the civil commitment order. As the state points out, however, the comment to Rule 20 qualifies this provision:
Rule 20.01, subd. 9 provides for credit for any confinement to a hospital or other facility under Rule 20.01, subd. 2(3).

(Emphasis added.)
The referenced subdivision, 2(3), relates solely to the confinement for an examination to determine competency. Reading the rule and the comment together, the *213 time "spent confined to a hospital or other facility" is restricted to that period of time during which the defendant is confined for the purpose of the medical examination. Because the rule can be read to include not only the time spent for the medical examination but also the time spent under a commitment order, our initial question is whether the comment should be given its restrictive effect.
Unlike the rules, the comments are not promulgated or approved by the supreme court. In promulgating the most recent amendments to the rules of criminal procedure, the court stated in its December 13, 1989 order:
The inclusion of Advisory Committee comments is made for convenience and does not reflect court approval of the comments made therein.
Although this explanatory language was not included in earlier orders, the court's past use of the comments for guidance rather than binding effect is consistent with the disclaimer. See, e.g., State v. Viergutz, 288 N.W.2d 693, 695-97 (Minn. 1980); State ex rel. Wild v. Otis, 257 N.W.2d 361, 364 (Minn.1977), cert. denied, 434 U.S. 1003, 98 S.Ct. 707, 54 L.Ed.2d 746 (1978). In State v. Notch, 446 N.W.2d 383 (Minn.1989) the court interpreted a comment to the Minnesota Sentencing Guidelines as advisory rather than controlling: "Even if the comment were otherwise, we would be reluctant to conclude that * * * because [the rule] itself is clear and unambiguous and makes no exceptions * * *." Id. at 386; accord United States v. Mihalopoulos, 228 F.Supp. 994, 1002 (D.D.C. 1964) (advisory committee notes to federal rules of criminal procedure not authoritative, but helpful in determining intent of framers of the rules).
Because the comments to the criminal rules are not promulgated or approved by the supreme court we are disinclined to rest our determination on a comment restricting the application of the promulgated rule. We also observe that even if the rule were read in light of the comment's restriction, it would only require that credit against sentence must be given for confinement for medical examination. Although an inference of exclusion of commitment time might arguably arise, it can also fairly be said that the comment simply does not address presentence commitment credit.

Rule 27.03 Sentencing Credit
All time spent in custody "in connection with the offense or behavioral incident for which sentence is imposed" is automatically deducted from the sentence under the terms of Minn.R.Crim.P. 27.03, subd. 4. The rationale for crediting presentence confinement is that an indigent defendant held on a bailable offense might otherwise serve a longer sentence solely because of indigency, that is, the inability to post bail. Williams v. Illinois, 399 U.S. 235, 90 S.Ct. 2018, 26 L.Ed.2d 586 (1970).
Bonafide could not post bail and he may have been indigent. With the exception of the presentence confinement under the commitment order, Bonafide received credit for his other presentence confinement and the circumstances of the civil commitment do not suggest manipulation or inappropriate action by the prosecution. See State v. Goar, 453 N.W.2d 28 (Minn.1990). The constitutional protections specified in Williams are not implicated here.
The Eighth Circuit Court of Appeals has concluded, in a case arising in Missouri, that a refusal to grant credit against a state sentence for time spent in federal custody at a medical center following a determination of incompetence to stand trial did not violate due process or equal protection rights. Harkins v. Wyrick, 589 F.2d 387, 392 (8th Cir.1979). See also Makal v. State of Arizona, 544 F.2d 1030 (9th Cir.1976), cert. denied, 430 U.S. 936, 97 S.Ct. 1563, 51 L.Ed.2d 782 (1977). In an indirectly related case the Minnesota Supreme Court recognized the constitutional distinction between confinement for treatment of mental illness and confinement in jail. State v. Bauer, 299 N.W.2d 493, 496 (Minn.1980). Although Minnesota has also recognized a separate state constitutional right to privacy for persons committed to Minnesota institutions, that right is not asserted *214 here. See Jarvis v. Levine, 418 N.W.2d 139 (Minn.1988).
Absent constitutional considerations, the determination of whether Bonafide's pretrial commitment was time spent in custody "in connection with" the offense or behavioral incident is essentially a matter of interpretation of the rule. The term "in connection with" has not been specifically defined either in the rules or by case law. See State v. Patricelli, 357 N.W.2d 89 (Minn.1984). The early cases interpreting "in connection with" generally related to distinguishing between current and previous offenses for crediting jail time. See, e.g., State v. Stout, 273 N.W.2d 621 (Minn. 1978). More recently the supreme court has extended custodial credit to include time spent in a juvenile detention center awaiting certification for prosecution as an adult, Escobedo v. Oleisky, 339 N.W.2d 263 (Minn.1983), and time against concurrent sentences accumulated during a holding period, State v. Dulski, 363 N.W.2d 307 (Minn.1985). In analyzing these issues the supreme court has considered the philosophy behind the rule and also looked to interpretations of other states. See Escobedo, 339 N.W.2d at 263 and State v. Hott, 426 N.W.2d 423 (1988) (discussion of change in approach to granting credit).
With the exception of the sentences considered in Harkins,[1]Makal, and Arsad v. Henry, 317 F.Supp. 162 (E.D.N.C.1970) (all federal cases applying state law), the courts of other states have uniformly given credit against sentence for presentence commitment to state mental institutions. In re Banks, 88 Cal.App.3d 864, 152 Cal. Rptr. 111 (Cal.Ct.App.1979); People v. Cowsar, 40 Cal.App.3d 578, 115 Cal.Rptr. 160 (Cal.Ct.App.1974); Tal-Mason v. State, 515 So.2d 738 (Fla.1987); State v. Ewell, 234 Md. 56, 198 A.2d 275 (Md.1964); Petition of Stearns, 343 Mass. 53, 175 N.E.2d 470 (Mass.1961); State v. La Badie, 87 N.M. 391, 534 P.2d 483 (N.M. Ct.App.1975); People v. Pugh, 51 A.D.2d 1047, 381 N.Y. S.2d 417 (N.Y.App.Div.1976); People v. Noble, 28 Misc.2d 646, 216 N.Y.S.2d 541 (N.Y. Sup.1961); Commonwealth v. Jones, 211 Pa.Super. 366, 236 A.2d 834 (Pa.Super.Ct. 1967).
These holdings have been based on constitutional grounds as well as statutory interpretation. Although we find no state that interpreted a rule or statute with the exact wording of our rule, many of the states required credit for presentence commitment when the rule or statute specifically restricted credit to "jail" time. See, e.g., Tal-Mason, 515 So.2d at 740.
The state does not dispute that Bonafide was in custody while at St. Peter. It is clear that the pretrial commitment arose during the time Bonafide was awaiting trial and consequently the custodial time in St. Peter was, in a general way, connected with the offense. Bonafide argues that because his civil commitment petition was based on the same actions that support his criminal charges that the time in custody on the commitment must be for the same offense or incident for which he was subsequently sentenced. However, we view civil commitment proceedings to be based on more than one particular set of actions and do not think that the consideration of the same behavioral incidents in both proceedings determines the issue. Whether pretrial mental commitment is confinement "in connection with" the offense should rest on a broader basis than whether the cluster of events triggering the proceedings are identical.
We are influenced in our analysis by the reasoning of other state courts on this same issue. We agree that the degree of deprivation of liberty in a mental commitment facility is equivalent to a jail or prison facility. Tal-Mason, 515 So.2d at 740. We believe that it is not reasonable to give credit when a defendant is confined to a hospital for a physical infirmity and deny it when the infirmity relates to mental disabilities. Noble, 216 N.Y.S.2d at 542. Similarly, there is no compelling reason to distinguish between preconviction and postconviction *215 custodial mental hospitalization in granting credit, see State v. Jorgenson, 176 Minn. 572, 224 N.W. 156 (1929), or to allow credit for custodial evaluation and deny it for commitment. We also note that the ABA Criminal Justice Mental Health Standard 7-4.15 (1989) provides that:
A defendant who has been detained or committed for examination of competence to stand trial or treatment or habilitation to effect competence to stand trial should receive credit against any sentence ultimately imposed for the time of such pretrial confinement.
(Emphasis added.)
The three express purposes of criminal sentencing in Minnesota are (1) to deter others, (2) to rehabilitate those convicted, and (3) to protect the public through confinement. Minn.Stat. § 609.01. The goals of mental commitment proceedings are not entirely symmetrical in that they are not intended to deter. Despite this essential difference, we are persuaded by the broad language of Rules 20.01, subd. 9 and 27.03, subd. 4, the reasoning of other states, the philosophy expressed by the supreme court, and as a matter of fairness, to interpret the rules as requiring credit against sentence for custodial time spent at St. Peter under a Rule 20 presentence commitment procedure.
In denying credit to Bonafide the trial court may have been influenced by our holding in Pladson v. State, 385 N.W.2d 406 (Minn.App.1986) in which we relied on the comment to the rule to state prospectively that defendant was not entitled to credit for time spent in a hospital pursuant to a constitutionally valid civil commitment. As Bonafide correctly argues, the issue was not squarely raised or briefed in that case and any language inconsistent with our present holding should be disregarded. The other decisions cited by the state as supporting exclusion of time relate to probationary conditions and are not inconsistent with our opinion. See State v. Peterson, 359 N.W.2d 708 (Minn. App.1984), pet. for rev. denied (Minn. Mar. 13, 1985); State v. Marti, 372 N.W.2d 755 (Minn.App. 1985), pet. for rev. denied (Minn. Oct. 11, 1985); Emmes v. State, 373 N.W.2d 608 (Minn.App.1985).

DECISION
We reverse the trial court's refusal to grant credit against appellant's criminal sentence for the presentence custodial period spent under a civil commitment order at the state security hospital.
Reversed and remanded for resentencing.
NOTES
[*]  Acting as judge of the Court of Appeals by appointment pursuant to Minn. Const. art. 6, § 2.
[1]  A subsequent case suggests that Missouri's application of credit for presentence commitment has changed. In Hart v. State, 588 S.W.2d 226 (Mo. Ct.App.1979) the appellate court extended credit for presentence time to a commitment to a research hospital as a condition of bail.
