
639 P.2d 166 (1981)
Randy SPAIN, Plaintiff and Appellant,
v.
Arden W. STEWART, Defendant and Respondent.
No. 17545.
Supreme Court of Utah.
December 11, 1981.
*167 Alvin G. Nash, Vernal, for plaintiff and appellant.
Clark B. Allred, Vernal, for defendant and respondent.
OAKS, Justice:
In this appeal from the dismissal of a petition for habeas corpus, we affirm the district court in its conclusion that the case had become moot.
Petitioner was arrested at 9:00 p.m. on November 10, 1980, for possession of a controlled substance. He was not brought promptly before a magistrate because of a mix-up about which magistrate should conduct his preliminary examination and because of the delaying effect of a probation officer's telephone request that petitioner be held by the sheriff.
On November 13, 1980, while the respondent sheriff was holding petitioner in the Uintah County jail, counsel petitioned for a writ of habeas corpus, citing two grounds for the illegality of petitioner's restraint by the sheriff: (1) he had not been taken before the magistrate "without unnecessary delay" for the review of charges and evidence and the fixing of bail, as required by U.C.A., 1953, § 77-7-23; and (2) he had not been provided a written statement of the nature of his alleged violation of probation. On that same day, the district court brought petitioner and respondent before the court, heard evidence, and ordered that petitioner be taken before the magistrate forthwith and then be released upon posting the bail fixed by that officer. The habeas corpus matter was then continued to November 25th. When the matter came before the court on that date and the court learned that all had been done as ordered and that petitioner had been released and was presently free on bail, the court dismissed the habeas corpus petition as moot.
Petitioner argues on this appeal that the legality of his restraint was not rendered moot by the proceeding before the magistrate and his release on bail because he continues under a constructive restraint in that he is readily answerable to the court and his movement is restricted under the terms of his bond. In support of this argument, he cites cases holding that challenges to the validity of convictions or findings of probable cause on the basis of the unconstitutionality of the statute, the insufficiency of the evidence, or other irregularities in the proceedings can be maintained by habeas corpus even though the petitioner has been released on bail. Jacobson v. State, 89 Nev. 197, 510 P.2d 856 (1973); Franklin v. State, 89 Nev. 382, 513 P.2d 1252 (1973); Schooley v. Wilson, 150 Colo. 483, 374 P.2d 353 (1962); In re Petersen, 51 Cal.2d 177, 331 P.2d 24, 77 A.L.R.2d 1291 (1958). These cases are akin to Jones v. Cunningham, 371 U.S. 236, 243, 83 S.Ct. 373, 377, 9 L.Ed.2d 285 (1963), which held that a state convict's release on parole did not render his federal habeas corpus proceeding moot because parole "imposes conditions which significantly confine and restrain his freedom... ." These authorities hold that where a habeas corpus petition challenges the legality of the judicial order by which the petitioner was convicted or committed, the fact that the petitioner is later released on bail or parole does not make the proceeding moot.[1]*168 But even assuming the application of those authorities, this case is moot for another reason.
The petition in this case calls upon the traditional habeas corpus function of assuring that a person is not "unjustly imprisoned or otherwise restrained of his liberty." Utah R.Civ.P. 65B(f).[2] Specifically, petitioner challenges the legality of the restraint originally imposed upon him when the sheriff held him in the county jail without prompt judicial review or fixing of bond. But once the magistrate held the preliminary hearing and specified a bail bond on November 13, the illegality petitioner had challenged was entirely resolved. The habeas corpus petition was thereby rendered moot, not because petitioner was no longer restrained, but because the only relief requested in his habeas corpus petition had been granted. Where the requested judicial relief can no longer affect the rights of the litigants, the case is moot and a court will normally refrain from adjudicating it on the merits. Duran v. Morris, Utah, 635 P.2d 43 (1981). The district court was therefore correct in dismissing appellant's petition as moot, and its judgment is affirmed.
HALL, C.J., and STEWART and HOWE, JJ., concur.
NOTES
[1]  Modern authorities provide a rationale for holding that a habeas corpus petition challenging the validity of a conviction does not become moot even when the petitioner serves his sentence and is released from prison and parole because the disabilities or burdens that flow from a criminal conviction give a petitioner "a substantial stake in the judgment of conviction which survives the satisfaction of the sentence imposed upon him." Carafas v. LaVallee, 391 U.S. 234, 237, 88 S.Ct. 1556, 1559, 20 L.Ed.2d 554 (1968). Accord, Sibron v. New York, 392 U.S. 40, 57, 88 S.Ct. 1889, 1899, 20 L.Ed.2d 917 (1968) (direct appeal from criminal conviction not mooted by appellant's service of sentence and release because "a criminal case is moot only if it is shown that there is no possibility that any collateral legal consequences will be imposed on the basis of the challenged conviction").
[2]  The history of this function of the writ is discussed in Oaks, "Habeas Corpus in the States  1776-1865," 32 U.Chi.L.Rev. 243, 258-64 (1965).

In contrast, this is not a case under our postconviction hearing provision, Utah R.Civ.P. 65B(i), which concerns persons "imprisoned in the penitentiary or county jail under a commitment of any court... ."
