Weaver, J.
The defendant Walter Anderson was indicted for a felony, and his bail fixed at $1,500. Instead *712of giving bail in the usual form, defendant executed an individual bond for that amount; and his father, Walter F. Anderson, secured it by depositing $1500 of his own money in the hands of the clerk who receipted to him for it, and defendant was thereon released. On September 20, 1902, the defendant was convicted, and sentenced to a term of imprisonment in the- penitentiary, and to pay the costs of the prosecution, taxed at $476. At the same time an order was executed fixing the amount of bail on appeal at $3,000. Within a few days thereafter an appeal was taken and perfected to this court. On September 30, 1902, Anderson, Sr., appeared in court, and, upon a showing that the son had surrendered himself in execution of the judgment against him, asked for a release and return of the deposit in the clerk’s hands. This motion was opposed by the county attorney, who claimed the money was liable to be applied to the payment of the judgment against the son for c sts. On October 3, 1902, the son filed an appeal bond in the sum of $3,000, with Frank Reno as surety; and afterward on the same day the court made an order sustaining the application of Anderson, Sr., for the release of the money deposited by him, and directing the clerk to return it, as demanded. This order was complied with, and later on the same day the surety on the appeal bond surrendered the defendant Walter Anderson to the sheriff, who received the prisoner, and gave the surety a receipt accordingly. Thereupon Reno, upon showing of such surrender and receipt, moved the court for an exoneration of his bond, which application was 'followed by a motion upon the part of the state for an order requiring the refunding of the $1,500 originally deposited by Anderson, Sr. In support of this motion, and in resistance to the motion to discharge the bond signed by Reno, it was alleged that the giving of the appeal bond was a fraudulent device adopted for the purp jse of releasing the money. The trial court sustained the position taken by *713■the state, and vacated the order releasing the deposit, directed the return of the money by Anderson, Sr., and ordered that the bond given by Eeno be not exonerated until he returned or caused to be returned into court the sum of $476, the amount of the costs adjudged against the prisoner. To this entry the court attached the following provision: “This order is not in any way intended to .affect the defendant’s right to have said money all returned to him upon going in good faith on appeal bond as required by law, and upon so doing he will be entitled thereto as provided by law.” From these rulings and •orders, Walter F. Anderson and Eeno appeal.
j. depo=it in heu of bond: return of: appeal bond: release of The statute provides that, after an order admitting to ■bail, the defendant, instead of giving bail, may deposit with the clerk a sum of money equal to the bail required, an(^j upon delivery of the clerk’s certificate 0f such deposit to .the officer having him in custody, he shall be discharged. Code, section 5524. It is further provided that after ■such deposit has been made, and before any forfeiture thereof, the defendant may still furnish bail in the ordinary manner, and upon so doing the court shall order the clerk to refund the money so placed in his hands. Section 5526. By the next following section it is directed that where money has been deposited by defendant, if it remain on deposit at the time judgment is rendered against him, the clerk shall, under the direction of the court, apply.[the same in satisfaction of so much of the judgment as requires the payment of money, and refund the surplus, if any, to the defendant, “unless an appeal be taken to the Supreme Court and bail put in, in which case the deposit shall be returned to the defendant.” •Sections 5528 and 5529 provide a method by which the sureties upon a bail bond may “at any time before forfeiture of their undertaking surrender the defendant in their exoneration,” and section 5530 allows a defendant who has *714deposited, money in lieu of bail to surrender him self to the custody of the proper officer, and thus release the deposit,.
The case chiefly relied upon by the appellee to sustain the order of the court below (State v. Owens, 112 Iowa, 407) is not controlling upon the questions here presented. Owens having been arrested for a misdemeanor, one Perry deposited money with the sheriff, in the nature of bail,, but without authority of law. Later an indictment was returned, and an order made fixing bail. Owens applied to the court for an order reducing the amount of bail required, and proposing, in lieu thereof, to deposit the money then in the sheriff’s hands. Accompanying the application was a written consent by Perry that the money be so used by Owens. The application was granted, and the money was deposited, and remained in the clerk’s hands until after Owens had been convicted and a fine assessed. Thereafter Perry undertook to surrender the defendant into custody, but did not take the proper statutory steps therefor. We there held that in view of the statute, and the order of the court made with Perry’s express consent, the money should be considered as having been deposited by the defendant, and subjected to the payment of the judgment against him. Here, however, we have a deposit made by a third person; we have also an appeal from the judgment of conviction to this court, with bail in the amount required; and we have the release and return of the money deposited as the statute directs shall be done under such circumstances. Code, section 5527. In this condition of affairs, the surety upon the appeal, following the strict form of law, surrenders the defendant to the sheriff in execution of the judgment, and demands the exoneration of his bond. This right is denied him unless he complies with a condition imposed by the court, requiring him to return or cause to be returned into court the sum of $476, which fund may again be released and refunded upon “going in good faith on appeal bond *715as required by law.” This order is sought to be justified, upon the proposition that the surrender of the defendant-so quickly after the bond was given, and after the order-refunding the money was entered, clearly indicates that the-bail was not furnished in “good faith,” but for the mere-purpose of securing the release of the money. But is this-reason sufficient to sustain the refusal to exonerate the-bond? The surety has, under the statute, an absolute-right “at any time” before the forfeiture of the bond to* surrender the defendant and be released. Code, section-5528. That right becomes perfect the moment the bondisaccepted and the defendant discharged from custody, and. continues until a forfeiture of the undertaking has been* declared or the conditions of the bond have been performed. If we are to say that a surrender within an hour is proof of fraudulent intent, who shall say at what particular point of time it may be made without bearing the-badge of bad faith? It is said that the admitted circumstances are such that we may assume the bond was given, with a preconceived purpose to surrender the defendant. Such purpose, if it existed, is not necessarily fraudulent.. It may often happen that bail is given to allow defendant brief respite for business or other reasons, and with the-express intent to surrender him as soon as that end is-accomplished, whether the interval be months, days, or hours, and such transaction would violate neither the-letter nor the spirit of the law. The only purpose of the-bond is to secure the production of the defendant in execution of the judgment from which he appeals, and if that-condition be performed the law is satisfied, without regard to the time such obligation is in force.
But assuming that in the present instance the bond was given with no other purpose than to enable Walter IV Anderson to secure the release of the deposit, is the state in any manner “defrauded” by the subsequent surrender of the defendant? It is not questioned that the giving of *716the bond “in good faith” would have made the right to a refund of the money absolute, nor is it disputed that in such case Reno would have had the right at any time pending the appeal to this court to release himself from liability upon the bond by giving the defendant back into custody. Now, if he may terminate his liability at any time by pursuing a line of action prescribed by the statute, it seems clear that the state suffers no legal injury or wrong because he avails himself of that right pursuant to a secret purpose existing in his mind at the time he signed the bond. In other words, so long as he does only that which the statute expressly authorizes him to do, it is not within the province of the court to make the motive which inspires his act a reason for denying him the right which such statute gives. The force of these suggestions is seen when we note the provision in the court’s order by which, if Reno pays the $476 into court, it may again be released by giving another bond “in good faith.” Let us suppose these terms are accepted, and another bond given in the utmost good faith, arid thereafter the surety, having good reason to believe the defendant is liable to abscond, surrenders him as provided by law; certainly it cannot be said, in the absence of a statute requiring it, that, in addition to the surrender, he must also restore the deposit, as a condition of the exoneration of his bond. The undertaking of a surety upon an appeal from a conviction of a felony is that “the defendant will surrender himself in execution of the judgment and direction of the Supreme Court, and in all respects abide the orders and judgment of the Supreme Court upon the appeal.” He does not undertake to pay the costs of prosecution in either court. If the judgment appealed from is affirmed, and the defendant is surrendered by the surety, or voluntarily surrenders himself, in execution of the judgment against him, and of the orders of the Supreme Court, the bond h s spent its force and should be discharged. A sur*717render made in advance of the judgment upon appeal has-precisely the same effect. The surety thereby does all he undertook or promised to do, and his exoneration cannot be denied as a means of compelling him to perform an act or duty not “nominated in the bond.”
Upon the appeal of Walter F. Anderson, it is argued by him that in no event is a deposit made in lieu of bail liable to be subjected to the payment of the costs. The Owens Case does not involve this question. The order there appealed from applied the money to payment of the fine and costs; and on the submission in this court it was not urged, nor did we consider, whether payment of costs, as distinguished from the fine, could be thus enforced. JSfeither is such question so essential to a disposition of the present appeal as to now require us to decide it. The appearance of Walter F. Anderson in the proceeding in the district court was somewhat analogous to that of an intervener asking the restoration to him of the money in the hands of the clerk. Assuming (for the purposes of this case only) that, if no bail had been given on the appeal, this money could have been applied to the payment of costs, it is not open to question that, upon such bail being furnished, the defendant or his father was entitled to demand a release of the deposit. The order was* made accordingly, and Anderson, Sr., having received his money, his connection with the proceedings appears to have been terminated. At least, the record does not indicate that he was thereafter in court, or was brought within its jurisdiction by process or.notice of any kind. But waiving any question of jurisdiction, we see no way to uphold the judgment by which the order for the release of the deposit was set aside, and its return commanded. If the statute provides, as we have seen it does, that the giving of bail upon an appeal has the effect to release the deposit, it would not be a fraud for the father to interest himself in procuring the bail, in order that his money might be restored to his *718possession. There is nothing in the record, however, to indicate that this bond was procured by his solicitation, except the circumstance of the speedy surrender of the defendant after the money was released. The order of release was a matter of right the moment after the bail was accepted. There is no objection raised that the bail bond was not a valid undertaking made in due form of law, or, if forfeited, could not have been enforced; and if valid and enforceable, as other appeal bonds, we see no reason why all the statutory incidents and rights attaching to or flowing from such undertakings are not available here. It may be that the statute which by one section .allows the defendant to release a money deposit by giving bail, and by another section allows the surety upon the bail bond to relieve himself from liability by surrender of his principal at any time before forfeiture of the bond, opens the way for the latter to rescue his money from the hazard of subjection to the claims of the state. This objection goes to the wisdom or policy of the statute, and not to its interpretation. If the statute confe'rs a right upon the performance of certain conditions, it is not our province to deny or nullify that right because it leads to results which we may believe were not foreseen by the legislature.
2. bail: Aeposit by third party. There is one other feature of this branch of the case which is worth considering. Thus far we have treated the deposit of money with the clerk upon the assumption that it was made under the statute which allows ** money to be taken by the clerk instead of bail. But this statute -does not contemplate the deposit of money by third persons, and we have held that bail cannot lawfully be allowed upon such security. State v. Owens, supra. The statute, as there interpreted by us, goes no further than to allow the defendant himself to deposit money equal to the bail required, and in such case no bond is taken or required. In State v. Farrel, 83 *719Iowa, 661, a defendant in a criminal case deposited money with the sheriff in lieu of bail, and, failing to appear for trial, the security was by the district court declared forfeited. The sheriff neglected to pay the money over pursuant to the order of the court, and suit was brought against him; but we held that, as the law did not authorize bail to be given in that manner, , neither the state nor county could maintain an action to recover it. The same principie is announced in Smart v. Cason, 50 Ill. 195. In the casus at bar a bond was given, reciting that Walter Anderson, as principal, and -- Anderson, as surety, undertook that the said Walter Anderson should appear and answer to the indictment against him. This bond was signed by Walter Anderson only, but to the instrument wa<s appended a receipt as follows: “Received of W. F. Anderson fifteen hundred dollars as surety on this bond. H. W. Michael, Clerk.” It thus appears that the transaction was not a deposit of money 'by the defendant in lieu of bail, but a deposit by a third person in lieu of a satisfactory surety upon a bail bond. This was a substantial departure from the statute, and the discharge of the defendant from custody thereon was unauthorized. It follows, therefore, under the doctrine of the Farrel Case, that neither the state nor county could maintain an action to recover such money if diverted from the purposes fcr which it was deposited. Possibly, if it was still in the clerk’s hands, the depositor would be denied the right of recovery. See Smart v. Cason, supra. But once restored to him, the state has no such interest in the fund as to compel its return to the clerk.
The orders appealed from must be held to have been erroneous, and they are reversed.