(dissenting).
[¶ 37.] I dissent because the denial of fourteen months credit for time served:
1) penalizes Closs for prevailing on his application for habeas corpus;
2) burdens Closs’ right to pursue relief through habeas corpus proceedings;
3) allows disparate treatment of inmates based on whether the court grants the State a stay pending appeal or has the inmate involuntarily committed to a mental institution;
4) extends Closs’ time in state custody by fourteen months without cause.
[¶ 38.] I do not question the propriety or ability of the Department of Corrections to institute involuntary commitment proceedings against an inmate in need of treatment. However, that is not the issue. The question is whether the denial of credit for fourteen months while Closs was involuntarily committed by the State during the pendency of the State’s appeal is proper. The answer to that question is an unequivocal “no.” Closs is entitled to credit against his prison sentence for the time he was involuntarily committed.
[¶ 39.] SDCL 21-27-1 provides:
Any person committed or detained, imprisoned or restrained of his liberty, under any color or pretense whatever, civil or criminal, except as provided herein, may apply to the Supreme or circuit court, or any justice or judge thereof, for a writ of habeas corpus.
State prisoners also have a right under the Constitution and federal statutes to bring a habeas corpus action in federal court once state remedies have been exhausted. By denying credit for the time served in HSC, this Court burdens Closs’ statutory right to habeas corpus proceedings. By exercising his right and prevailing, the only thing Closs accomplished was to extend his time in custody for fourteen months. This was an end run by the State and a denial of due process and equal protection to Closs.
[¶ 40.] Rather than being analogous to credit for time served prior to conviction, this case is more analogous to credit for time served pending appeal. For example, in Holland v. Boles, the defendant was given a life sentence which was later overturned, but only after he had served eleven years on that sentence. When the defendant was retried and sentenced, he was initially denied credit on the eleven years served under the original sentence. In ordering that credit be given for that time, the court stated,
denial of credit for time served while in the de facto status of state prisoner is so fundamentally unfair as to constitute a violation of the Due Process and Equal Protection Clauses of the Fourteenth Amendment of the Constitution.
Holland v. Boles, 269 F.Supp. 221, 224 (D.C.W.Va.1967) (quoting Patton v. North Carolina, 256 F.Supp. 225, 236 (W.D.N.C.1966)). Furthermore,* it has been held that “[t]o deny credit for time spent in jail after conviction if a person pursues his right to appeal is to place a burden on the *322exercise of that right ...” Arsad v. Henry, 317 F.Supp. 162, 164 (1970). This case is sufficiently analogous to grant Closs credit for time served while undergoing involuntary “treatment” at HSC. The denial of credit for time served is unfair and wrong.
[¶ 41.] First, there can be no question that Closs’ liberty was restricted during the time served at HSC. He could not leave HSC during the time he was committed. Additionally, we have held that far less intrusion on an inmate’s liberty constituted confinement for purposes of determining time served. In State v. Rollag, we unanimously held (with Justice Henderson concurring in result) that an inmate was entitled to credit for time served while he was on work furlough. 400 N.W.2d 278 (S.D.1987). In State v. Kiggins, we unanimously held that an inmate could be convicted of escape based on the defendant’s failure to return from a work release program stating, “[u]ntil his discharge by due process of law he remained under the legal restraint of his sentence and in constructive custody of the jail.'” 86 S.D. 612, 615, 200 N.W.2d 243, 244. (emphasis supplied). If a person free to come and go for work, as in Kiggins, and a person allowed to live at home as in Rollag, is confined for purposes of time served, certainly one wholly restricted to a mental institution against his will, with no possibility of leaving, is similarly confined and equally entitled to credit.
[¶ 42.] Second, the majority relies heavily on the fact that it was the County Board’s decision to commit Closs. This assertion is immaterial when one acknowledges that if not for the Department initiating those proceedings, Closs would not have been involuntarily committed. Therefore, even if we were to accept the majority’s test concerning whether Closs was entitled to credit, the fact is that but for his conviction and subsequent punishment, the Department would not have been able to institute such action. These events lead to the conclusion that his detention in the HSC was directly “related to his punishment for the [] conviction.” Therefore, he is entitled to credit.
[¶ 43.] Third, despite the fact that Closs prevailed in his habeas proceeding, the State never intended to let him out of its control. As soon as the court ruled in Closs’ favor, the State applied for a stay pending appeal. Upon denial of that petition, involuntary commitment proceedings were immediately instituted. Closs did not have one moment free of State control from the time he prevailed in the habeas proceeding and that decision was overruled and he was returned to the penitentiary. There was no time when Closs was at liberty, nor could there have been. The real effect of the State’s actions in this case was to involuntarily extend his sentence by fourteen months.
[¶ 44.] Without question, Closs would have been entitled to credit for time served had he remained in the penitentiary pending the State’s appeal. The only difference here is that the State failed in its attempt to keep him in the penitentiary. He was transferred to HSC through no fault or action of his own, but rather through the Department’s decision to commence involuntary commitment proceedings. The involuntary commitment proceedings were instituted immediately after the State’s petition for a stay was denied. As soon as Judge Piersol’s decision was overruled, the Department immediately transferred Closs back to the penitentiary. Nobody inquired as to how his “treatment” was progressing, or whether he had a continuing need for such “treatment” or discussed the possibility of keeping him in “treatment” rather than returning him to prison. The State decided it would keep him confined, and because it could not *323keep him confined in prison, it caused him to be involuntarily committed to HSC instead.
[¶ 45.] The only person who seems to doubt his need for treatment is Closs, and it seems clear that lacking a substantial improvement in his mental health, he will once again be returned to HSC for treatment when his sentence is finished. That is insufficient reason to deny him credit against his prison term for time involuntarily served at HSC. In fact, it may be one more reason to grant him the credit he deserves.