Stephens, J.
J. B. Anchors brought suit against A. E. Rood, to recover a sum of money which the plaintiff alleges he had paid to Rood for the latter’s services as a real-estate broker in procuring for the plaintiff a purchaser of a business operated by the plaintiff, which consisted in the operation of storage garages. The plaintiff’s *77right to a recovery was based upon alleged fraud of the defendant in obtaining the purchaser by a misrepresentation made by the defendant to the purchaser as to the character of the plaintiff’s business, by reason of which representation the purchaser negotiated the contract through the defendant as the plaintiff’s agent. It was alleged by the plaintiff that the commission was paid to the defendant without knowledge on the part of the plaintiff of either the alleged fraud perpetrated upon the purchaser by the defendant when acting as the plaintiff’s agent or the repudiation by the purchaser, through the defendant as the plaintiff’s agent, of the. contract of sale which the defendant had negotiated; and it was further alleged that the defendant, after the purchaser had repudiated the contract, procured another person, whom the defendant represented to the plaintiff as being the purchaser’s agent, to take possession of the plaintiff’s business, and from whom the defendant collected and paid over to the plaintiff the sum of $4,000 as a cash payment which had been agreed upon in the contract of sale with the first purchaser; and it was further alleged that the plaintiff all the time believed, as the result of the defendant’s conduct and representations, that the person taking possession of the plaintiff’s business was doing so as agent for the first purchaser, whereas in fact the defendant, who was purporting to act as the plaintiff’s agent, had sold the property to the person who had taken possession of the plaintiff’s business, and that this person had, upon the discovery of the defendant’s conduct in negotiating the sale to this person and representing to the plaintiff that this person was the agent of the purchaser, repudiated the contract, and had obtained from the plaintiff a refund of the purchase-money less a sum equal in amount to the commission which this person had paid to the defendant as the plaintiff’s agent, and which the defendant had paid to the plaintiff under the representation made by the defendant to the plaintiff, and upon the belief by the plaintiff, that the money had been paid by the first purchaser obtained by the defendant. A demurrer, both general and special, was filed, the material ground of which was that the petition set out no cause of action, in that since the plaintiff, when reimbursing the purchase-money which the person who had taken charge of the plaintiff’s business had paid to the plaintiff, had retained the amount of the commission which had been paid to the defendant, the plaintiff had *78suffered no damage. This demurrer was overruled, and the defendant excepted.
The law requires utmost good faith on the part of an agent with his principal, when undertaking to carry out the contract of agency; and where the agent, through no fault of the principal, fails to perform the duties for which he has been employed, or where: through the agent’s fault, by reason of fraud perpetrated by him, a contract which he has negotiated for his principal’s benefit is unenforceable and is repudiated by the person with whom the agent has contracted, and thus the agent has failed to perform the duties of the agency, the agent is not entitled to compensation from the principal. It follows necessarily that when the principal has paid the agent for services rendered pursuant to the contract of agency, and is in ignorance of the fact that the agent has failed in the performance of his duties as agent, the principal has a right, upon a discovery of this fact, to recover the money thus paid to the agent as compensation. Where by the terms of the contract of agency the agent, as a real-estate broker, is to procure a purchaser of property belonging to the principal, and the agent by exceeding his authority and misrepresenting the property perpetrates a fraud upon the purchaser and thereby obtains an unenforceable contract with the purchaser, and on account of the fraud the contract is rescinded by the purchaser, and the agent knowingly, and without' the principal’s knowledge, substitutes as purchaser one who the principal believes is an agent of the purchaser whom the agent had procured, the agent thereby fails to act in good faith with his principal, and the principal is entitled to recover from the agent compensation for the services which the principal had paid to the agent in ignorance of the fraud of the agent in obtaining the contract, and in ignorance of the purchaser’s rescission of the contract.
Although the plaintiff had been paid the purchase-money for the sale of the property, it is immaterial, and can not affect his right as against his agent, that an amount of the purchase-money equal to the commission had not been refunded by the principal to the purchaser. The agent can not defeat his just debt to the principal because the principal may owe the same amount to another and has not paid it. Nor would the agent be entitled to defeat his just debt to the principal simply because a person had donated to the principal a sum of money equal to the debt, where *79this sum of money was not given to the principal for and in behalf of the agent and in extinguishment of the agent’s obligation to the principal. The petition set out a cause of action, and the demurrer was properly overruled.
Judgment affirmed.
Jenlcins, P. J., and Bell, J., concur.