delivered the opinion of the court.
1. The city charter of 1893 (Laws 1893, p. 564), in force at the time of the levy of January 7, 1904, and January 11, 1905, provided (Section 127) that the city shall constitute an independent road district, and for -road purposes is expressly taken from the jurisdiction and control of the county court. The charter of 1905, in force at the time of the levy of January 6, 1906, by Section 114, which corresponds with Section 127 (page 595) of the charter of 1893, in taking from the county the jurisdiction over the territory within the City of Eugene for road purposes, also expressly takes away the power to levy-taxes for road purposes, and road and poll taxes are by both charters given over to the control of the city, and the city is authorized to levy a' road tax to be collected as other taxes. By Section 3098, B. & C. Comp., which has been in force since 1S93, cities and school districts are required, after making their tax levy, to notify the county clerk thereof, and by Section 3094 the county clerk shall include such city and other tax levies with the county levy in extending the same upon the tax roll, and they shall be collected by the sheriff as other taxes are collected. It has been decided by this court, in Salem v. *470Marion County, 25 Or. 449 (36 Pac. 163), and Oregon City v. Clackamas County, 32 Or. 491 (52 Pac. 310), that, where the county collects road taxes belonging to the city that should have been collected by the city officers, the county is required to pay over the same to the city, and this is conceded by defendant; but it is claimed that the case at bar does not come within the ruling in Salem v. Marion County, for the reason that the road tax levy in the latter case, even within the city, was properly made by the county court, but that it was the duty of the city’s officers, and not the sheriff, to collect the tax. In this case, as well as in that, the county had no right or claim to the money. It properly belongs to the city. In Salem v. Marion County, 25 Or. 449 (36 Pac. 163), the tax was collected by the wrong officer, while in this case it was collected by the right officer, but the levy made by the wrong body; and the whole reliance by the defendant, to justify its refusal to pay the money over to the .city, is that it is liable only to the taxpayers, and not to the city. However, if the levy was void and might have been resisted by the taxpayer, yet, when he has voluntarily paid it, he is precluded from questioning the regularity of the proceeding or the validity of the .levy. It is held in Brown v. School District, 12 Or. 345 (7 Pac. 357), that the collection of a void tax may be enjoined, or payment thereof may be made under protest and the amount recovered back. But when once voluntarily paid by the taxpayer he is precluded from thereafter attacking its validity.
2. It is generally conceded that a tax voluntarily paid cannot be recovered back, and it is immaterial in such a case that the tax has been illegally levied. Before a taxpayer can recover it back, the tax must be illegal and the payment must have been made under compulsion: Coolejc Taxation (2 ed.), 805, 809. In People ex rel. v. Brown, 55 N. Y. 180, 187, where the validity of the tax was questioned by the collector, the court say:
“The defendant cannot claim to retain the money as the representative of the taxpayers. There is no relation of principal and agent, or trustee or cestui que trust, existing between *471the taxpayers and the collector; and it does not appear but that it was paid by them voluntarily, and under circumstances which would prevent their recovering it back from any one.”
Similar language was used in Berrien County Treasurer v. Bunbury, 45 Mich. 79, 85 (7 N. W. 704, 706):
“He received it in payment of taxes, and as money belonging to the public. Whose money is it? Those who were assessed voluntarity paid it in satisfaction of their tax dues and in the discharge of their duty as citizens. * * Can it be an answer to this suit'brought- for its recovery to say: * * But it could not have been obtained if the taxpayers who freely paid and do not complain had held back for compulsory measures? We think not.” .
See, also, Lovingston et al. v. Board of Trustees, 99 Ill. 564; O'Neal v. Board of School Com'rs, 27 Md. 227. Cooley, Taxation, 705, says the collector “would not be permitted to rely upon technical objections which might be made to the right of the public to the money. If he receives the money to the use of the public, he should account for it; and it is immaterial that those who have paid it might successfully have resisted the collection from them. The principles here stated are applicable, not merely to the ease o-f a defect in the official authority, but to the case, also, in which defects, either technical or substantial, might have been urged to the tax the officer has enforced.”
In Salem v. Marion County, 25 Or. 449 (36 Pac. 163), it is said:
“The principle that an obligation rests upon all persons, natural and artificial, to do justice, so that, if a county obtain money or property of others without authority, the law, independent of any statute, will compel restitution or compensation, is not questioned.”
3. By the terms of the statute above cited, the county is made the tax collector for cities and school districts, and it stands in that relation to them in all proceedings in relation thereto. If the county tax collector collects a void municipal tax and turns it over to the municipality, the remedy of the taxpayer, if he has saved his rights, is against the municipality, *472and not against the collector: Cooley, Taxation, 805. The county’s position is wholly untenable. It has levied a road tax within the city, evidently in good faith, believing that that was the method for raising road taxes for the city, but now says that the city, and not the county, should have made the levy, and that it will, therefore, keep the money, on the theory that the city has no title to it. Although it was the duty of the city to have levied the tax, the county court assumed to do so, and then collected it, as was its duty, if properly levied. The city, by its conduct in claiming the tax, has ratified the levy, and the taxpayer has voluntarily paid the tax; hence it is clear that the fund is the property of the city, and the county is not justified in refusing to pay it over.
The judgment of the lower court is affirmed. ' Affirmed.