
189 A.2d 805 (1963)
Donald Joseph BENOIT
v.
Harold V. LANGLOIS, Warden.
M. P. No. 1526.
Supreme Court of Rhode Island.
April 4, 1963.
*806 Leo Patrick McGowan, Public Defender, for petitioner.
J. Joseph Nugent, Atty. Gen., Corinne P. Grande, Special Counsel, for State.
POWERS, J.
This is a petition for habeas corpus seeking to procure an order for a reduction in the amount of bail set by a superior court justice, which is herein alleged to be excessive and violative of art. I, sec. 8. of the constitution of this state.
The petitioner represents to this court that on January 17, 1962, at which time he was serving a four-year sentence for breaking and entering, the grand jury for the counties of Providence and Bristol returned indictment No. 31028 which charged him with conspiracy to escape from the adult correctional institutions. He further represents that on the following day bail was set by a superior court justice in the amount of $20,000 and petitioner continued to serve such sentence until September 17, 1962, on which date it was completed.
The attorney general appearing on behalf of respondent concurs in such representation, and in the further representation that on September 20, 1962 petitioner made application to the superior court for a writ of habeas corpus, returnable October 17, 1962. At this point, however, the representations of petitioner and the attorney general are at variance. The former asserts that his petition was denied by the court without giving him an opportunity to be heard, while the attorney general represents that no effort was made to show that the amount fixed was excessive as to petitioner, but rather he was content to argue that the bail was excessive on its face.
We are, however, not reviewing the decision of the superior court justice rendered October 17, 1962 on application for the writ made to that court. The instant proceedings were initiated in this court as an original application for the writ pursuant to the jurisdiction vested herein by G.L. 1956, § 10-9-22. See Lee v. Gough, 86 R.I. 23.
It is petitioner's contention, buttressed by numerous authorities, that the object of bail is to assure the presence of the accused when put upon his trial, but that in fixing the amount the court should take into consideration such factors as the accused's pecuniary circumstances, the nature of the offense charged, and the penalty upon conviction. Failure to give due consideration to his financial resources, he argues, violates art. I, sec. 8, of the state constitution when the amount fixed by the court is manifestly beyond the ability of the accused to furnish. The constitutional provision upon which he relies is as follows: "Excessive bail shall not be required, nor excessive fines imposed, nor cruel punishments inflicted; and all punishments ought to be proportioned to the offense."
This court had occasion to consider this provision in Snow, Ex Parte, 1 R.I. 360. There, the petitioner had been charged with embezzling some $80,000 from a bank of which he was cashier. Bail had been set in the sum of $25,000 which, on application for habeas corpus, he alleged to be excessive. This court, considering the same contention as is made by the instant petitioner, stated at page 363: "The language is not high bail, but excessive  that is, such an amount *807 above what is reasonable as would show a palpable error of judgment or a disposition to oppress."
Continuing, the court observed that the penalty for the offense charged was a fine not exceeding $5,000 or imprisonment not exceeding five years. Commenting upon the petitioner's complaint that the amount of bail required was greatly in excess of the maximum fine, and, further, that the petitioner had made an assignment of his property to the bank, this court observed that not only the fine but the punishment of five years in prison should be considered.
The court stated at page 363:
"The bail required ought to be such as will afford a reasonable security that the prisoner will abide the sentence of the court, should he be found guilty. If a man has fifty thousand dollars, and only five thousand is demanded, it would afford no security. The means of the accused should be considered. This applicant is charged with embezzling sums to the amount of fifty thousand dollars, and we do not think it would be exercising a sound discretion to reduce his bail. It is said that he has made an assignment; but how much he has surrendered does not appear. He may make an assignment and keep back the funds."
It would appear from the foregoing that this court was concerned with the petitioner's means only to the extent that the same related to securing his appearance when demanded by the state and not on the issue of whether the amount fixed was excessive. We consider such to be a sound application of the rule.
Moreover, a review of the authorities wherein the pecuniary circumstances of the accused have been considered, discloses that it is but one of a number of factors to be taken into consideration by the court and has no peculiar significance so as to set it apart as a factor having exceptional merit. In People ex rel. Rothensies v. Searles, 229 App. Div. (N.Y.) 603, 604, it is stated:
"The purpose of requiring the defendant to give bail after arrest is to secure his presence at the trial. The amount necessary for that purpose is a question of sound discretion and judgment depending upon several primary conditions that may be present in any particular case. The nature of the offense, the penalty which may be imposed, the probability of the willing appearance of the defendant or his flight to avoid punishment, the pecuniary and social condition of defendant and his general reputation and character, and the apparent nature and strength of the proof as bearing on the probability of his conviction  all these are elements which may properly be taken into consideration by the court in determining the amount of bail."
As heretofore noted, petitioner concedes that although he stresses pecuniary circumstances, other factors are material in determining the amount of bail calculated to insure the presence of the accused when required. He contends, however, that considering his extreme youth when first incarcerated, the nonviolent nature of previous offenses, his lifelong residence in this state, and the nature of the offense charged, the sum of $20,000 is clearly excessive. He urges that $2,500 would be proper in adjusting the rights of society vis-a-vis his constitutional right to bail.
In our judgment there is merit in petitioner's contention that in all the circumstances the sum of $20,000 is excessive. We are not prepared to agree, however, that the maximum suggested by him would reasonably tend to guarantee petitioner's presence on demand. There is nothing before us save the representations made in his petition and conflicting assertions in the briefs of both parties.
Indeed it is somewhat troublesome to determine how best to afford petitioner *808 the relief he seeks by way of the instant petition. The office of habeas corpus is to procure the release of an applicant for the writ on a proper showing that his detention is illegal. The instant petitioner prays, and properly so, not for such relief but rather for a determination that the amount of bail in which he is being held is excessive. It would seem that he would have been better advised to have appealed from the fixing of bail in the first instance by way of certiorari. Such an appeal would have brought up the record, which on review and a determination that the amount of bail imposed was excessive could have been remanded to the superior court with direction to correct the same in accordance with our opinion.
Be that as it may, however, we are constrained to treat the instant petition as though such procedure had in fact been adopted.
The petition for habeas corpus is granted, the respondent is directed to return the petitioner to the superior court for the purpose of a new fixing of bail, and said court is ordered to consider that question and to fix bail not in excess of $7,500.
