This is a suit in the nature of a bill of interpleader. The First National Bank of Superior failed when Nuckolls county was an unpaid depositor therein to the extent of $13,189.61, including an overdeposit of $3,189.61 made by the county treasurer in violation of statute. Rev. St. 1913, sec. 6662. For the protection of county funds deposited in the bank the American Surety Company had become liable on the bank’s depository bond in the penal sum of $10,000. The National Fidelity & Casualty Company was surety on the county treasurer’s official bond. After the bank failed the county treasurer filed with the receiver a claim for $13,189.61. The American Surety 'Company promptly paid the county the amount of its liability as surety ($10,000) and to that extent procured an assignment of the deposit. Later the Fidelity & Casualty Company paid the county the remainder of the deposit ($3,189.-61), took an assignment of it, and also obtained a formal assignment of the claim for $13,189.61, which the county treasurer had filed with the receiver. The receiver afterward ' paid the National Fidelity & Casualty Company a dividend of $1,979.37, being 15 per cent, of the county’s entire deposit of $13,189.61. The sureties are rival claimants to dividends. The purpose of the suit, which was brought by the receiver, is to determine the respective rights of the sureties. As defendants they are joined with Orval C. Myers, county treasurer. The trial court held that the American Surety Company, the surety on the bank’s depository bond, is entitled to share the dividend with the National Fidelity & Casualty Company, the surety on the treasurer’s bond, in the proportion that $10,000 bears to $3,189.61. Judgment was accordingly rendered in favor of the American Surety Company against the National Fidelity & Casualty Company for $1,664.50, being 15 per cent, of $10,000, with interest. The latter has appealed.
The sureties are not contesting the validity or priority of separate claims against the insolvent bank, but are assert*482ing hostile claims to dividends on a single nncontested claim for an unpaid deposit of $13,189.61.
The treasurer’s surety calls attention to the liability of the bank’s surety for the bank’s obligation to safely keep the deposits of county funds, to pay “each and every part thereof, upon the written demand of the county treasurer,” and to “save and keep the people of Nuckolls county, and the county treasurer harmless and indemnified.” In this connection the treasurer’s surety argues that, having paid the debt of $3,189.61 owing by the treasurer and the bank to the county, it is by subrogation entitled to all of the rights and remedies of both; that the county and the treasurer, after receiving $10,000 from the bank’s surety, are entitled to dividends on $13,189.61, until the overdeposit of $3,189.61 is fully paid; that the effect of allowing the bank’s surety to draw dividends before the overdeposit is paid from the assets of the bank is to reduce the penalty in the depository bond below $10,000, thus injuring the county and the treasurer; that the bank’s surety is not entitled to the benefits of subrogation until the bank’s debt is paid in full. On the other hand, the bank’s surety insists that, when it discharged its full liability by paying $10,000, which would have been, the maximum amount of its principal’s indebtedness to the county, except for the illegal overdeposit made by the treasurer, it was, to the extent of $10,000, subrogated to all of the rights of the county. The question thus presented is not free from difficulty. The courts have not agreed on the solution. There is reason on both sides of the controversy. The doctrine invoked by the treasurer’s surety has been stated as follows:
“As a surety is not entitled to subrogation until the debt is paid in full, a surety on a bond to secure a city in the deposit of moneys in an insolvent banking institution is not entitled to subrogation, though he has paid the bond, where the bank was still largely indebted to the city, and the total amount of dividends, together with the amount of the bond, would not discharge the obligation; for in such case, if the surety were pro rata subrogated to the *483city’s right to receive dividends, the city would.be injured.” Knaffl v. Knoxville Banking & Trust Co., 133 Tenn. 655. Board of Health v. Teutonia Bank & Trust Co., 137 La. 422; Buffalo German Ins. Co. v. Title Guaranty & Trust Co., 99 N. Y. Supp. 883; Commissioner of Banking v. Chelsea Savings Bank, 161 Mich. 691.
.There is a recognized exception to the general rule, however, where the surety discharges his full liability to the creditor by paying the entire debt protected by his surety-ship, though the principal still' owes the creditor an additional sum. The doctrine on which the exception is based seems to have been first announced in Ex parte Rushforth, 10 Ves., Jr. (Eng.) 409. In a later English case the principle was restated in the following form:
“When a surety is only surety for a part of the debt, and has paid that part of the debt, he is entitled to receive the dividend which the principal debtor pays in respect of tha.t sum which the surety has discharged.” Gray v. Seckham, L. R. 7 Ch. (Eng.) 680.
A review of the English cases shows that the doctrine on which the distinction is based is firmly established. Ellis v. Emmanuel, 1 Exch. Div. (Eng.) 157. While the leading case has been criticised in Knaffl v. Knoxville Banking & Trust Co., 133 Tenn. 655, as announcing a doctrine at variance with the rules of equity governing subrogation, the exception, in the opinion of another American court, rests on a logical basis. Buffalo German Ins. Co. v. Title Guaranty & Trust Co., 99 N. Y. Supp. 883.
In the present case, what is the contract of suretyship into which the bank’s surety entered? The depository bond for $10,000 was executed under a statute providing:
“For the security of the funds so deposited under the provisions of this article the county treasurer shall require all such depositories to give bonds for the safe-keeping and payment of such deposits and accretions thereof, which bond shall run to the people of the county and be approved by the county board, and conditioned that such depository shall, at the end of each and every month, render *484to the treasurer and county board a statement in duplicate, showing the several daily balances and the amounts of moneys of the county held by it during the month, and the amount of the accretion thereof, and how credited. * * * The treasurer shall not have on deposit in any bank at any time more than the maximum amount of the bond given by said bank in cases where the bank gives a guaranty bond.” Rev. St. 1913, sec. 6662.
The statute is by construction a part of the depository bond. Blaco v. State, 58 Neb. 557. In entering into the contract of suretyship, the surety had a right to assume that the treasurer would comply with the statute and limit his deposit to $10,000. The bond was given to protect legal deposits of county funds to the contractual and statutory maximum of $10,000, and not as security for an illegal deposit in excess of that sum. Both the surety’s liability and the debt protected by the suretyship are limited to $10,000. In paying the amount of the bond, the bank’s surety not only discharged its legal liability, but also discharged the entire debt to secure which the bond was given. The terms of the contract of suretyship, when considered with the statute and with the public duties of the treasurer, will admit of no other construction.
After the bank’s surety paid the county the bank’s debt in the sum of $10,000, it became .a creditor of the bank to that extent, and the county, by reason of the treasurers illegal overdeposit, remained a creditor in the sum of $3,189.-61. The trial court held that the two creditors described should share ratably in the dividends declared by the bank’s receiver. The ruling is challenged as erroneous, for the reasons that the treasurer, when the bank failed, became personally liable to the county for the amount of the unpaid overdeposit; that the bank’s surety agreed to indemnify him; that the surety on the treasurer’s bond paid the county the remainder of the bank’s debt for which the treasurer was liable, amounting to $3,189.61, and was thus subrogated to the treasurer’s rights; that consequently the bank’s surety will not be entitled to participate in *485dividends until the bank’s debt for which the treasurer is liable has been paid from the assets of the insolvent bank.
The position is unténable. The treasurer’s surety cannot trace through subrogation to the treasurer a right to dividends superior to that of the bank’s surety. The treasurer’s compliance with the statute would have prevented the bank from incurring an indebtedness to the county in excess of $10,000. In that event the debt of the bank would have been paid in full. By making an over-deposit contrary to the letter of the law, the treasurer incurred a personal liability to the county which otherwise would have had no existence. Neither the treasurer nor his surety will be permitted to make use of this wrongful act to establish a right to dividends superior to that of the bank’s surety.
Under the conditions outlined, the further point that the treasurer’s surety, by asserting rights of the county, can prevent the bank’s surety from sharing ratably in the dividends does not seem to be well taken. The reason for the rule that a surety is not entitled to subrogation until the debt of the principal has been paid in full does not apply to the facts in the present case. The bank’s surety paid the entire debt for which the depository bond was given as security. If injury to the county would result from permitting the bank’s surety to share the dividend, the county’s loss would not grow out of the debt secured by the depository bond. Such loss, if any, would be traceable to the illegal conduct of the treasurer in making deposits in excess of the penalty named in the depository bond. For this wrongful act on the part of the treasurer, neither the bank’s surety nor the county is in anywise responsible. If the treasurer had complied with the law, the principal’s debt would be paid in full and the right of the bank’s surety to subrogation would be unassailable. In that event the ultimate loss of the bank’s surety would be less than the maximum amount for which the depository bond was given. To deny or postpone subrogation because the treasurer, for whose wrongful act the bank’s surety was not responsible, *486made overdeposits in violation of law would extend the liability of the bank’s surety beyond that created by the contract of suretyship. In respect to the dividends, therefore, the bank’s surety and the treasurer’s surety are asserting claims of equal rank. This conclusion results in the affirmance of the judgment of the district court.
Affirmed.
Sedgwick and Hamer, JJ., not sitting.