For a number of years H. A. Croghan was tax collector of the county of San Diego with the American Surety Company of New York as surety on his official bonds. On January 15, 1932, the County of San Diego instituted this action against Croghan and the surety company to recover money collected as taxes by Croghan and not deposited with the county treasurer of San Diego County. Croghan and the surety company filed separate answers to the complaint and the surety company filed a cross-complaint against Croghan and others whereby it alleged that the county had withheld from Croghan his salary in the sum of $3,737.10, accruing since the shortages were discovered, asking a restraining order preventing the withdrawal of this money from the county treasury, and seeking
*496
for judgment over against Croghan in any amount it might be compelled to pay on the bond, and that it be subrogated to Croghan’s salary up to an amount it should pay on the bond. In his answer to the cross-complaint Croghan alleged that any shortage in his official collections, if one existed, was caused by the peculations of two 'of his deputies and that the surety company executed surety bonds for these deputies in the sum of $7,500 each. The deputies were not made parties to the action. On February 16, 1933, and at the time of the trial, M. W. Conkling intervened, claiming the unpaid salary Under an assignment given him by Croghan on July 27, 1932, in consideration of attorney’s fees principally earned in the ease of
People
v.
Croghan,
At the trial it was stipulated by all parties that the shortages in Croghan’s accounts against which the statute of limitations had not run in favor of the surety amounted to $18,390.93. This amount was paid by the surety to the county in open court in the presence of counsel for all parties, who stipulated that it was correct, Croghan maintaining, and offering to prove, that the money did not all belong to the county, but included collections of taxes for cities, irrigation and school districts in San Diego County. The complaint of the plaintiff was not dismissed, but all parties proceeded as though such dismissal had been entered. The only issues tried were those framed by the cross-complaint, the complaint in intervention and the answers to these pleadings. The judgment was responsive to these issues and no others. The American Surety Company of New York was given judgment against Croghan for $18,390.93, together with accrued interest in the sum of $321.82, and costs. The county was ordered to cancel the salary warrants issued in Croghan’s name and to pay their amounts, totaling $3,737.10, to the surety, and that this payment be credited on the judgment against Croghan and partial satisfaction be entered for the amount paid. Such partial satisfaction of the judgment is incorporated in the record. This judgment is now before us for review.
Croghan urges that (1) the county can only recover the tax money collected for its own use and not that collected for cities, irrigation and school districts, and (2) that he *497 should have been permitted to offset against the judgment in favor of the surety on his bond, which was also surety on the bonds of his deputies, the amounts of their alleged defalcations.
Intervener urges two additional grounds for reversal of the judgment: (1) That where the salary of an officer is earned and assigned, but not paid, and suit is' brought by the county against the officer and his surety, and judgment is entered for the full amount of the shortage without deduction of the unpaid salary and the surety pays the judgment, it does not acquire a lien upon the unpaid salary. (2) That the officer’s salary cannot be offset against a judgment where the county is suing as trustee of an implied trust.
In the briefs of both appellants many of their arguments are based upon the assumption that the County of San Diego recovered a judgment against Croghan which is before us on this appeal. Such is not the case. As we have observed, the judgment before us is in favor of the surety company against Croghan and intervener. If there was a judgment in favor of the county it is not in the record. Therefore, the right of the county to sue its tax collector for shortages in its own funds, and funds collected for cities, irrigation and school districts, is not directly involved in this appeal.
The duty of collecting these taxes is imposed by law upon the county tax collector. He is required by law to settle with the county auditor monthly (see. 3753, Pol. Code) for all collections and pay all moneys collected to the county treasurer. (Secs. 3753, 4126, Pol. Code.) If he fails to do this for five days he is liable for the full amount of taxes charged upon the assessment-roll. (Sec. 3754, Pol. Code.) The county is the lawful custodian of these funds and must disburse them in accordance with law.
(Buena Vista W. S. Dist.
v.
Shields,
Croghan’s attempted defense that he was entitled to set oft against the surety company any defalcations by his deputies must fail for the following reasons:
The bonds of the deputies were made payable to the state of California. No one other than the obligee can bring suit on such bond unless such an one is injured or aggrieved by the defalcation of the principal. (See. 961, Pol. Code; Municipal Bond Co. v. City of Riverside, supra, and cases cited.) There was no claim made during the trial that Croghan had paid any of the purported defalcations of his deputies. Up to the time of such payment by him he could not have been injured or aggrieved by such defalcations, if any. The only payment out of funds once belonging to Croghan was the application on the judgment after it was rendered of his past due salary in the amount of $3,737.10, leaving a balance unpaid of $14,986.15. The total of the bonds of the two deputies amounted to $15,000 or $13.85 more than the balance of the judgment exclusive of interest on it. Interest accruing between the date of the judgment and the credit on it amounted to over $17. The amount of the defalcations of the deputies, if any, was *499 not and could not have been determined in this action as they were not made parties to it and such question was not within the issues formed by the pleadings. Croghan was not entitled to set off any supposed defalcations of his deputies under the facts here disclosed.
When the surety paid to the County of San Diego the amount of Croghan’s shortage it became subrogated to all the rights of the principal creditor which it had paid. In
Estate of Elizalde,
The foregoing considerations effectively dispose of the material contentions made by Croghan on this appeal. There remains for decision the appeal of the intervener, who claims the salary of Croghan under an assignment given him prior to the payment by the surety of the shortage.
In addition to the doctrine of the subrogation of a surety on the payment of the debt of the principal which
*500
we have already set forth, it seems to be settled by good authority that the right of subrogation goes back to the date of the contract of suretyship and takes priority over a prior assignment.
(Prairie State Nat. Bank
v.
United States,
The intervener was attorney for Croghan in this and other actions involving and growing out of the shortage in the tax collector’s office. He had notice of all of the facts and circumstances of the cases prior to taking the assignment. His assignment cannot take priority over the rights of the surety which paid his assignor’s shortages. The cases last cited establish this principle. (See, also,
Farmers’ State Bank of Richardton
v.
Stieg,
Judgment affirmed.
Barnard, P. J., and Jennings, J., concurred.
