
244 A.2d 271 (1968)
John E. LEMME, Jr.
v.
Harold V. LANGLOIS, Warden.
No. 15-M. P.
Supreme Court of Rhode Island.
July 19, 1968.
*272 Leonard A. Kamaras, Providence, for petitioner.
Herbert F. DeSimone, Atty. Gen., Donard P. Ryan, Asst. Atty. Gen., for respondent.

OPINION
ROBERTS, Chief Justice.
This petition for a writ of habeas corpus was brought by the petitioner to obtain his discharge from the allegedly unlawful custody of the respondent warden. At the time the petition was brought, the petitioner had been in the custody of the respondent pursuant to an order of a justice of the superior court sentencing him to a term of 90 days in the adult correctional institutions after having been adjudged in contempt of court. At the same time the court imposed a sentence of 11 months on the petitioner pursuant to his plea of nolo contendere to an indictment charging him with receiving money under false pretenses.
The record discloses that petitioner was indicted in November 1965 on a charge of obtaining money under false pretenses, and on December 6 entered a plea of not guilty thereto. On January 17, 1966, petitioner appeared before the superior court and entered a plea of nolo contendere to the charge set out in the indictment. Subsequently, petitioner was taken into custody March 31, 1966, on a capias, but April 21, was released on personal recognizance to appear May 5 for disposition of the case. The petitioner was again taken into custody on June 17 and was held at the adult correctional institutions without bail for disposition of the case on August 8, 1966.
The petitioner thereafter moved for permission to change his plea on the indictment from nolo contendere to not guilty, alleging in his motion that the entry of the plea of nolo contendere "* * * was done by mistake." At a hearing on this motion on September 22, 1966, petitioner testified : "Well, I had never been into court before. I never got involved in any crime or anything, and between guilty and nolo, to me, it didn't mean anything because I never knew what either one meant or what was involved, actually." Thereafter the trial justice stated that he was satisfied that petitioner had lied in so testifying, saying with respect to his testimony : "This was a deliberate falsehood which was given in the presence of the Court, and I intend to treat it summarily at this time." He then adjudged petitioner in contempt of court and sentenced him to serve a term of 90 days and, denying the motion to change the plea from nolo contendere to not guilty, sentenced petitioner on a plea of nolo contendere to the indictment to a term of 11 months to run " * * * from and after the expiration of the sentence for contempt of 90 days * * *."
Shortly thereafter, on October 3, 1966, while he was incarcerated pursuant to the sentence of 90 days for contempt of court, petitioner brought the instant petition for habeas corpus and in connection therewith moved to be admitted to bail pending hearing thereon. This court on that petition directed the attorney general to show cause why the writ should not issue and thereafter ordered the writ to issue and, pursuant to petitioner's motion therefor, admitted him to bail.
The state questions, first, whether petitioner here is entitled to the issuance of the writ, arguing that, having been admitted to bail, petitioner's personal liberty is in no way curtailed. It relies on our decision in Moretti v. Langlois, 94 R.I. 470, 181 A.2d 625. There we adopted the view that to be entitled to the issuance of the writ, the applicant must be imprisoned or otherwise restrained of his personal liberty, but that once the applicant, so restrained, has been released or discharged therefrom, the issue becomes moot and no useful purpose would be served by further consideration thereof. *273 The rule as thus stated in Moretti might well be the prevailing rule in cases where the applicant for the writ is, in fact, at that time free from all restraint and custody.
However, some doubt as to the validity of this construction of our statute, G.L.1956, § 10-9-1 et seq., has been raised by the construction given the federal habeas corpus statute, 28 U.S.C. § 2241 et seq., in Carafas v. LaVallee, 391 U.S. 234, 88 S.Ct. 1556, 20 L.Ed.2d 554. There the United States Supreme Court said that the federal statute by its terms requires that the applicant be "in custody" when the application for habeas corpus is filed but does not limit the relief that may be granted to discharge of the applicant from physical custody. The court said, in part: " * * * we conclude that under the statutory scheme, once the federal jurisdiction has attached in the District Court, it is not defeated by the release of the petitioner prior to completion of proceedings on such application."
The instant case, however, does not confront us with a situation in which petitioner is free of all restraint, as was the situation in Carafas, where the applicant had completed service of the sentence that had been imposed upon him. In the instant case petitioner is a person who had been admitted to bail, and, as we understand the issue, the question is whether under § 10-9-1 he is a person who is " * * * otherwise restrained of his liberty by any officer or other person * * *" and, therefore, entitled to the issuance of the writ if the custody from which he was freed on bail was unlawfully imposed. We are of the opinion that admission of an accused person to bail does not operate so as to relieve him of all custodial restraint. The great weight of authority is to the contrary and supports the view that such person is in custody of the bail and, constructively at least, in the custody of the law.
The object of bail in a criminal case is to assure the presence in court of the accused for trial, Quattrocchi v. Langlois, 100 R.I. 741, 744, 219 A.2d 570, 573, and to put the accused as much under the power of the court as if he were in the custody of the proper officer. Matera v. Buchanan, Fla. App., 192 So.2d 18. Admission to bail keeps the accused "* * * constructively in the custody of the court * * *." State v. Olson, S.D., 152 N.W.2d 176, 177. We adopt the view that one who has been admitted to bail is " * * * not only in the custody of his bail, but he is also in the custody of the law.'" State v. Bates, 140 Conn. 326, 330, 99 A.2d 133, 135. We hold then that petitioner here, having been admitted to bail, was restrained of his liberty within the meaning of § 10-9-1 and, therefore, was entitled to the issuance of the writ if the custody in which he is held is unlawful.
We turn then to the question of whether the custody in which petitioner was held pursuant to the sentence of a term of 11 months, from which custody he was admitted to bail on order of this court, was unlawful. He argues that the denial of his motion for permission to withdraw his plea of nolo contendere deprived him of his constitutional right to a trial by jury and to an appeal from a verdict returned by the jury. As we understand him, he is arguing that he may withdraw his plea of nolo contendere and enter a plea of not guilty as of right and that a denial of this right at any time prior to the imposition of sentence on the plea of nolo contendere denies him his constitutional right .to a jury trial.
In Cole v. Langlois, 99 R.I. 138, 206 A.2d 216, we noted that a plea of nolo contendere is for all purposes related to the indictment to which it is entered equivalent to a plea of guilty. We there held that where a plea of nolo contendere is entered by an accused voluntarily and intelligently, it constitutes a waiver of his right to trial by jury. The antecedent issue then to be determined is whether in the instant case the entry of the plea of nolo contendere constituted a valid waiver of petitioner's right to trial by jury. In Fay v. Noia, 372 U.S. 391, 439, 83 S.Ct. 822, 849, 9 L.Ed.2d 837, 869, the Supreme Court said : "The classic definition of waiver enunciated in Johnson v. Zerbst, 304 U.S. 458, 464, 58 S.Ct. 1019, 1023, 82 L. *274 Ed. 1461,`an intentional relinquishment or abandonment of a known right or privilege' furnishes the controlling standard." We turn then to the record here to ascertain whether, in pleading nolo contendere, petitioner voluntarily, intentionally, and intelligently relinquished his right to a jury trial.
The transcript discloses that on January 17, 1966, petitioner, when arraigned before a justice of the superior court, was represented by able counsel who, on petitioner's behalf, entered a plea of nolo contendere. Counsel went on to inform the court that he had discussed with petitioner, then the defendant, the various pleas that could be made to the indictment, including a plea of not guilty, with a jury trial claimed, and a plea of guilty. He then went on to say: "* * * and we discussed the plea of nolo itself, which the defendant just made through his counsel. I have explained to Mr. Lemme that the plea of nolo is equivalent to a plea of guilty, and that Your Honor would have nothing to do but to sentence Mr. Lemme as the Court saw fit, with no appeal. No offer or promise of any kind has been made to Mr. Lemme in respect to the plea of nolo. Is that correct, Mr. Lemme ?" To counsel's inquiry the record discloses that petitioner replied, "Yes."
The court then went on to inquire of the defendant whether he understood that by pleading nolo "* * * you are giving up your right to plead not guilty, and giving up your right to a trial?" To this inquiry petitioner answered, "Yes." The court went on to ask him, "You understand there will be no trial?" and petitioner again responded, "Yes." The court then inquired whether petitioner knew that the only thing left to do was to impose sentence and that the plea of nolo is the same as a plea of guilty as far as the court is concerned. To both statements petitioner replied, "Yes." The court further inquired whether petitioner was aware that whatever sentence the court imposed, there would be no appeal from that sentence. Again petitioner answered in the affirmative. On this record we are constrained to conclude that both the trial justice and counsel informed petitioner of the effect of the plea he was submitting to the court and, in so pleading, he effectively waived his constitutional right to trial by jury.
The question remains whether, petitioner having entered a plea of nolo contendere in a voluntary relinquishment of his known right to a trial by jury, it was error on the part of the trial justice to deny his motion to withdraw that plea and enter a plea of not guilty. In short, the question is whether there may be a retraction on the part of a defendant of his plea of nolo contendere after a waiver of jury trial. It is settled that a motion to withdraw such a plea of nolo contendere is addressed to the sound judicial discretion of the court and that a decision of the court thereon will not be disturbed by this court unless there is a clear abuse of discretion. In re Lanni, 47 R.I. 158, 131 A. 52. This appears to be the view taken by a substantial number of jurisdictions. Maes v. People, 155 Colo. 570, 396 P.2d 457; Cohen v. State, 235 Md. 62, 200 A.2d 368; State v. Williams, 39 N.J. 471, 189 A.2d 193; State v. Payne 24 Wis.2d 603, 129 N.W.2d 250.
In Maes v. People, supra, a motion was made to withdraw a plea of nolo contendere and enter pleas of not guilty and not guilty by reason of insanity. The Colorado court in that case, stating its adherence to the view that such a motion is addressed to the judicial discretion of the trial court, then proceeded to discuss what would warrant an exercise of the discretion favorable to the defendant. The court went on to say : " * * * there must be some showing that justice will be subverted by a denial thereof, as where a defendant may have been surprised or influenced into a plea of guiity when he had a defense; where a plea of guilty was entered by mistake or under a misconception of the nature of the charge; where such plea was entered through fear, fraud, or official misrepresentation ; or where it was made involuntarily for some reason."
*275 In our opinion, the above-quoted language discloses a number of conditions which, if established, properly should move a trial court in an exercise of its discretion to permit the retraction of a plea of nolo contendere. This discretion should be exercised with some liberality to prevent a subversion of justice when a defendant has made a showing that some reasonable doubt exists as to his guilt. Where a defendant meets the burden and raises a question of reasonable doubt as to his guilt, it is our opinion that a denial of the motion to retract the plea will amount to an abuse of discretion.
The defendant here urges that he was not permitted by the trial justice to show the existence of serious doubt as to his guilt. Because of the nature of this contention, we have closely scrutinized the entire transcript without finding that any substantial effort had been made to challenge the question of guilt. Neither does it appear from the transcript that the trial justice did not afford the defendant reasonable opportunity to offer evidence tending to establish the reasonable question as to his guilt of the offense charged in the indictment. In these circumstances we are constrained to conclude that the trial justice was not confronted with any evidence susceptible of reasonable inferences that a question as to the defendant's guilt existed. In such circumstances we hold that there was no abuse of discretion on the part of the trial justice in denying the motion to withdraw his plea of nolo contendere.
The petition for habeas corpus is denied and dismissed, the writ heretofore issued is quashed, the records certified are ordered returned to the superior court, and the petitioner is remanded to the custody of the respondent warden in accordance with the superior court's order of commitment.
JOSLIN, J., whom PAOLINO, J., joins, concurring. While I agree that the applicant's admission to bail did not in the circumstances of this case render his petition for habeas corpus moot, I cannot agree, as the majority appear to hold, that a person once admitted to bail is necessarily and in all cases so restrained of his liberty as to be entitled to have the legality of his custody determined on habeas corpus. The great weight of authority[1] is clearly to the contrary. And of the cases relied upon by the majority, although they speak of a person released on bail as being constructively in the custody of the law while on bail, only Carafas v. LaVallee, 391 U.S. 234, 88 S.Ct. 1556, 20 L.Ed.2d 554, is concerned with the question of mootness, and it is clearly distinguishable on its facts.
In that case, the supreme court held that proceedings for federal habeas corpus will not be defeated if an applicant, prior to a final adjudication of his petition, is released by reason of the expiration of his sentence. Noting that the application for federal habeas corpus was first made in June 1963 and that final adjudication had not been completed by March 1967 when the applicant's sentence expired, and further observing that the federal statute does not limit relief to discharge from physical custody, but permits the courts, in addition, to "`dispose of the matter as law and justice require,"' the court refused to penalize the applicant because of the inevitable delays in the judicial process. Then, relying upon the encompassing nature of the relief permitted under the federal statute and motivated by a desire to alleviate the applicant from the civil disabilities flowing from a conviction, it held that his petition could be adjudicated even though he was no longer in custody. That holding is certainly not authority for the majority's conclusion that a person admitted to bail is restrained of his liberty and therefore entitled to the issuance of the writ if the constructive custody in which he is held is unlawful.
*276 In this case, I dismiss the state's claim of mootness, not because petitioner may be in constructive custody while at large on bail, but because G.L.1956, § 10-9-12,[2] specifically provides for admission to bail pending judgment on a petition for habeas corpus. Here, the applicant was in the actual custody of the respondent warden when he sought leave to apply for the writ and his request to be admitted to bail was not acted upon favorably until after leave to file his petition for habeas corpus had been granted. In admitting him to bail, we acted under authority of § 10-9-12, in the enactment of which the legislature clearly did not contemplate that action thereunder would defeat a petition for habeas corpus.
I would hold, therefore, that a petition for habeas corpus does not become moot because the applicant, pending hearing or adjudication, is admitted to bail as provided for by the statute.
NOTES
[1]  The cases are collected in A.L.R. annotations. The earlier decisions are at 14 A.L.R. 344, and the more recent ones at 77 A.L.R.2d 1307.
[2]  The statute reads: "Until judgment be given the court may remand the party, or may bail him to appear from day to day, or may commit him to the sheriff of the county, or place him under such other care and custody as the circumstances of the case may require."
