This action was brought to recover a definite sum of money from the sheriff of Idaho county and the American Surety Company, the company who furnished the sheriff’s bond. The existing conditions in this ease grew out of an execution sale of cordwood. The cordwood was sold under execution by the deputy sheriff, who, it is alleged in the complaint, announced at the sale that he would sell 600 cords of wood and asked for bids. No bids were offered. After some conversation between the deputy sheriff and the plaintiff, the deputy sheriff then announced that he would receive bids by the cord for all of the wood belonging to the judgment debtor; that he would collect for the wood on the basis of 600 cords, and that if upon measurement it was found *797there were not 600 cords, the proportion of the purchase price for the shortage would be returned to the purchaser. It is alleged that upon those conditions the appellant made a bid, which was accepted by the deputy sheriff as the highest and best bid. Appellant then paid to the deputy sheriff the amount of his purchase by the cord upon the basis of 600 cords. The wood was thereafter measured and it was found there were only 430 cords. Appellant thereupon demanded of the sheriff the return of the purchase price of 170 cords at the rate paid by the cord. This was refused by the sheriff and this action was brought.
General demurrers were filed to the complaint, which were sustained by the court. The appellant having refused to plead further, judgment was entered, dismissing the action. This appeal is from that judgment. The action of the court in sustaining said demurrers and entering judgment of dismissal is assigned as error.
The main question for determination is whether the sheriff is legally responsible for the acts of his deputy in making said sale as he did.
It appears from the allegations of the complaint that the plaintiff would not have purchased said wood on the basis of 600 cords had the deputy declined to receive the bid and accept the price therefor with the agreement and understanding that the wood should be measured and if it fell short of the 600 cords, the purchase price of such shortage would be returned to the bidder. Then, is the sheriff and his sureties legally responsible for said acts of his deputy? The undertaking of the sheriff is conditioned as follows: “Now, therefore, if the said John E. Byrom shall well, truly and faithfully perform all official duties now required of him by law, and shall well, truly and faithfully execute and perform all of the duties of such office of sheriff required by any law to be enacted subsequently to the execution of this bond, then this obligation to be void, otherwise to remain in full force and effect. ’ ’
Under the provisions of sec. 293, Rev. Codes, every official bond executed by an officer pursuant to law is in- force and *798obligatory upon the principals and sureties therein for any and all breaches of the conditions thereof committed during the time such officer continues to discharge any of the duties of or hold the office, and whether such breaches are committed or suffered by the principal officer, his deputy, or clerk.
It was held in Foley v. Martin, 142 Cal. 256, 100 Am. St. 123, 71 Pac. 165, 75 Pac. 842, that the deputy is not the agent or servant of the sheriff but his representative, and a sheriff is liable for his acts the same as if they had been done by himself. (See, also, 33 Cyc. 1618, sec. B; Work Bros. v. Kinney, 7 Ida. 460, 63 Pac. 596.)
In the ease of State, Use of Wilson, v. Fowler, 88 Md. 601, 71 Am. St. 452, 42 Atl. 201, 42 L. R. A. 849, the court quotes with approval from Knowlton v. Bartlett, 1 Pick. 274, as follows:
“An official act does not mean what the deputy might lawfully do, in the execution of his office; if so, no action would ever lie against the sheriff for the misconduct of his deputy,” and adds: “That is to say, if only lawful acts are official acts, then the sheriff is never responsible for the acts of his deputy, since by a lawful act of the deputy no one can be injured in legal contemplation, while for an unlawful act— since not an official act — the person who is thereby in fact injured is not permitted to sue the sheriff.Surely it is a just inference from the above that if he commits a wrongful act in the discharge of his official duty his sureties are responsible, and it is within the terms of their contract.”
The trial court evidently took the view that said agreement of the deputy with the appellant was absolutely void. Certainly, if that agreement was entered into in good faith, it would be most unjust and unconscionable to permit the sheriff, through his deputy, to thus practice such a deceit upon the purchaser and compel him to pay more for the wood than he intended to bid and did in fact bid.
But it is contended by counsel for the respondents that the rule of caveat emptor applies to all sales of personal property made under execution. That, to a certain extent, may be true, but to permit the sheriff to thus impose on a purchaser in order *799to get more for the property than he could otherwise get would not only be unconscionable but inequitable, and unless the law warrants such deceit and fraud to be perpetrated by the sheriff at an execution sale, the trial court erred in sustaining said demurrers. The rule of caveat emptor might be invoked here to apply to the title, but it ought not to be applied to the quantity of wood, under the allegations of the complaint, which allegations are admitted to be true by the demurrer.
It is stated in 24 Cyc., p. 57, as follows:
“It is a well settled principle that the doctrine of caveat emptor applies to judicial sales. The purchaser obtains just the title the debtor had; and it has been held that in the absence of fraud, excusable mistake, or misrepresentations respecting the title which have misled him, he will not be relieved from his purchase because the title to the property has failed, where the proceedings would pass the title if the debtor had had it.”
In the case at bar the appellant does not ask to be relieved from the purchase because the title to the property had failed. He simply insists on the sheriff’s complying with the contract of purchase and returning to him the proportionate part of the purchase price represented by 170 cords of wood which he did not receive under the sale, or at all. In execution sales a sheriff is not required to make any representations, and if he follows the law he cannot be held for damages to any person injured in such sale. When, however, the sheriff receives a bid and makes a sale of eordwood with the understanding and agreement that the purchaser shall only pay for the actual number of cords in the lot sold, and agrees that the wood shall be measured to ascertain the number of cords after the sale, if he receives more money than the wood is worth at the price per cord bid, he ought to be held liable to the injured party for the excess if he agreed to return such excess to him. The bid for said wood was by the cord; the sheriff accepted the bid; he represented that there was a total of 600 cords but agreed with the bidder that he should pay for the 600 cords and promised that he would return to the purchaser *800the amount bid by the cord for whatever shortage there might be. It does not seem that there is any place in. this ease for the application of the rule of caveat empior. The purchaser merely purchased the amount of wood that the judgment debtor had there to be sold at that execution sale. The agreement between the parties and the representations of the sheriff makes the application of the rule of caveat empior impossible in this case. The sheriff procured the bid by making certain promises that he had a right to make. The appellant, relying on those promises, purchased said wood and made the deposit on the basis of 600 cords, and if the allegations of his complaint be true, which the demurrer admits, he certainly has a right to recover for the shortage in said wood. The deputy sheriff was engaged in the performance of an official act in selling said wood on execution. He was acting entirely within the authority of law in making said sale. Every act in connection with said sale was done under color of office, or virtute officii.
It has been suggested that the sheriff, under the law, was required to make his return of said sale within a certain time or be liable to pay a penalty if he failed to do so. That is true, and it no doubt was the duty of the plaintiff to have said wood measured and the amount determined before the sheriff, under the law, was required to make a return of said sale.
In Lee v. Charmley, 20 N. D. 570, 129 N. W. 448, 33 L. R. A., N. S., 275, it is stated in the syllabus as follows:
“The purpose of an official bond is to provide indemnity against malfeasance and misbehavior in public office, the misuse of powers belonging to the office, and the assumption, under guise of official action, of powers not belonging to it. All acts so performed, though unlawful or wrongful, are official acts within the meaning of an undertaking that an officer shall faithfully and impartially discharge the duties of his office; and as such may be reasonably considered to have been within the contemplation, of the sureties at the time they entered into the undertaking, as constituting a breach of its conditions.”
*801If tbe deputy sheriff made the contract with the plaintiff as set forth in the complaint, he received pay for 600 cords of wood when he sold only 430 cords. He received that money at that sale under the agreement alleged and in his official capacity, and we know of no law that would relieve him or his bondsmen of the liability-to the plaintiff under the allegations of the complaint. Having thus received the money, he and his bondsmen are liable, provided the wood was measured and the demand made for a return of the money before he was required under the law to make a return of said sale. In Richards v. Nye, 5 Or. 382, the court held that where a conditional payment was made by a debtor to the sheriff and he agreed to hold it for a time, he was not bound to do more than to allow to such debtor the full time which the execution had to run to determine the legality of the execution. It seems that there was a question in regard to the legality of the execution in that case, and the court held that the sheriff might legally hold the money until the law required him to return the execution instead of returning it immediately. The complaint may be uncertain in not stating the date when the wood was measured and when the demand was made for the return of a portion of said money, but that cannot be reached by general demurrer.
The court erred in not overruling said demurrers. The judgment must therefore be reversed and the cause remanded for further proceedings in accordance with the views expressed in this opinion. Costs are awarded to the appellant.
Stewart, C. J., concurs.