
2 Cal.App.2d 494 (1934)
THE COUNTY OF SAN DIEGO, Plaintiff and Respondent,
v.
HERBERT A. CROGHAN, Defendant and Appellant; AMERICAN SURETY COMPANY OF NEW YORK, Defendant and Respondent; M. W. CONKLING, Intervener and Appellant.
Civ. No. 1145. 
California Court of Appeals. Fourth Appellate District.  
November 28, 1934.
 M. W. Conkling, in pro. per., and Harry W. Horton for Appellants.
 Thomas Whelan, District Attorney, F. T. Dunn and F. P. Buckley, Deputies District Attorney, James G. Pfanstiel, Mathes & Sheppard, James G. Sheppard and George R. Richter, Jr., for Respondents.
 Marks, J.
 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 case of People v. Croghan, 131 Cal.App. 351 [21 PaCal.2d 614].) On the issues thus framed the case proceeded to trial.
 [1] 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.
 [2] 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 (sec. 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, 126 Cal.App. 241 [14 PaCal.2d 559, 15 PaCal.2d 861].) It must account to the various political subdivisions for the moneys collected for their use. (City of Fullerton v. County of Orange, 140 Cal.App. 464 [35 PaCal.2d 397].) It is immaterial in this case whether the county is a trustee of the tax money collected for the use of other political subdivisions or merely a bailee of such money. It was lawfully collected by its *498 officer and the money was unlawfully abstracted by someone in the tax collector's office. It did not belong to the tax collector or his deputies and he is responsible for its safekeeping and delivery into the county treasury. The county, whether a trustee or bailee of the money of other political subdivisions, may require the return of the money. (Miller & Lux v. Batz, 142 Cal. 447 [76 P. 42]; MacMullan v. Kelly, 19 Cal.App. 700 [127 P. 819]; Bode v. Lee, 102 Cal. 583 [36 P. 936].) A political subdivision may sue the surety on the bond, collect the money misappropriated and disburse the funds so collected to the political subdivisions lawfully entitled to any part of it. (Municipal Bond Co. v. City of Riverside, 138 Cal.App. 267 [32 PaCal.2d 661].) The tax collector cannot question the right of the county to sue for these funds as he had no property in them and his only duty is to collect them and pay them into the county treasury. (Placer County v. Astin, 8 Cal. 304; People v. Love, 25 Cal. 520; McKee v. Monterey County, 51 Cal. 275; City and County of San Francisco v. Ford, 52 Cal. 198; People v. Bunker, 70 Cal. 212 [11 P. 703].)
 [3] Croghan's attempted defense that he was entitled to set off 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. (Sec. 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.
 [4] 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, 182 Cal. 427, at page 433 [188 P. 560], it is said: "A surety, upon satisfying his principal's obligation, is entitled to be subrogated not only to the rights and remedies of the creditor against the principal connected with the debt, but is also entitled to be subrogated to the similar rights and remedies of the principal against the creditor. In Sheldon on Subrogation, at section 1, it is said: 'Subrogation is a doctrine of equity jurisprudence although its principles are often applied in courts of common law; especially in those states in which equitable remedies are administered through the forms of law. It is a substitution ordinarily of another person in the place of a creditor. ... More broadly, it is the substitution of one person in the place of another, whether as a creditor or as the possessor of any other rightful claim ... In this country its principles have been more widely developed and its doctrine more generally applied than in England. ... It is so administered (here) as to secure real and essential justice without regard to form. ...''' The surety also became subrogated to all of the rights of its principal (Croghan) to recoup its losses in any manner that Croghan could have done had he paid instead of his surety. (Title Guaranty etc. Co. v. Duarte, 54 Cal.App. 260 [201 P. 790].) It follows that the American Surety Company was subrogated to all rights of action against the deputies. (Seward v. National Surety Co., 120 Ohio St. 47 [165 N.E. 537]; Brinson v. Thomas, 55 N. C. 414.)"
 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.
 [5] 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, 164 U.S. 227 [41 L.Ed. 412, 17 S.Ct. 142]; Henningsen v. United States Fidelity & Guaranty Co., 208 U.S. 404 [52 L.Ed. 547, 28 S.Ct. 389]; American Surety Co. of N.Y. v. Vinton, 224 Mass. 337 [112 N.E. 954]; Fidelity & Casualty Co. of New York v. Livingston, 234 Mich. 375 [208 N.W. 446]; Laski v. State, 217 App. Div. 420 [217 N.Y. Supp. 48].)
 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, 56 N. D. 851 [219 N.W. 776]; McKinley v. Smith, 128 Cal.App. 591 [17 PaCal.2d 1032].) Under the circumstances here disclosed the assignee has no better title than his assignor. (McKinley v. Smith, supra.)
 Judgment affirmed.
 Barnard, P. J., and Jennings, J., concurred.
