
98 Cal.App.2d 829 (1950)
FLOYD L. OWENS, Respondent,
v.
ROSE HASLETT, Appellant.
Civ. No. 7715. 
California Court of Appeals. Third Dist.  
Aug. 10, 1950.
 P. H. McCarthy, Jr., F. Nason O'Hara and Herbert S. Johnson for Appellant.
 Lowell & Lowell for Respondent.
 VAN DYKE, J.
 This is an appeal from a judgment denying any relief to Rose Haslett, cross-complainant. Plaintiff below, Floyd L. Owens, to whom likewise all relief was denied, but who does not appeal, contracted with defendant Rose Haslett for the building of a dwelling house, for a price of $6,400. It was agreed that payments would be made, one-third when the subfloor was laid, one-third when the roof was on, and the balance when the building was completed. It appears that one Mary DeMartini owned the land on which the house was to be built, but further mention of her as a party is unnecessary since she does not appeal. She was not a party to the contract. Her mother, Rose Haslett, was building the house as a gift to her.
 The work was begun and payments on account were made. When plaintiff considered the building two-thirds completed he requested additional payment up to two-thirds of the agreed price. This was not forthcoming and the plaintiff ceased work. *831 Thereafter defendant employed another contractor to finish the work, and the total cost to her was above the plaintiff's contract price.
 Plaintiff, claiming defendant had breached the contract by refusing payment, filed a lien claim for the amount he claimed due him, and brought this action to foreclose the same. Defendant answered, denying his allegations that she had breached her contract, alleging breach on his part by use of defective material, defective workmanship, and abandonment without cause; she counterclaimed and also cross-complained, alleging the aforesaid breaches and asking damages. Hereafter we shall refer to the parties to this appeal as Owens and Haslett.
 At the trial it developed that Owens was not, when he contracted, nor for some time after the work was begun, a licensed contractor as required by division 3, chapter 9, article 5, of the Business and Professions Code.
 The trial court in its findings of fact found as follows: that the building contract pleaded had been entered into; that Owens began work thereunder and continued periodically until the 11th day of May, 1946, at which time he ceased further work; that on the 9th of May he was "entitled to the second progress payment as provided in said agreement" (a finding we interpret as meaning that the work was two-thirds completed, and done as called for by the contract); that he thereupon demanded of Haslett that she complete the second progress payment and that upon such demand she failed to do so; that the building contract was silent as to the time of completion; that Haslett failed to prove faulty construction; that Owens was not a licensed contractor as required by the Business and Professions Code of this state at the time the contract was entered into, nor when he commenced performance thereunder. As conclusions of law from the foregoing findings of fact the court declared as follows: that Haslett totally breached the contract on May 9, 1946, "justifying plaintiff [Owens] in terminating performance"; that because of this breach Haslett was to be denied recovery for "additional building costs as prayed" in the cross- complaint; that claimed loss of rentals could not be allowed because, the contract being silent as to time of completion, such loss was not within the contemplation of the parties; that damages claimed for faulty material and workmanship be denied as not proven; that because Owens was not a licensed contractor Haslett's *832 motion for nonsuit against him should be granted and recovery by him denied. The judgment decreed that no recovery be had by any party against another, and from this judgment, so far as it decreed no recovery upon the cross-complaint, Haslett has appealed.
 It may be said here that the foregoing factual findings are supported by the evidence. Indeed, that issue is not raised by the appellant Haslett. Her contentions revolve around what she conceives to be the legal consequences flowing from Owens' lack of a license. Her contentions as advanced in her brief are stated in this way: Owens violated the law; Haslett was not in pari delicto and the illegality of the contract is not therefore in and of itself a bar to relief; justice and equity require some form of relief and she should be permitted either to recover what she has already paid Owens or to hold him accountable as for a breach of his contract in failing to complete the building, thus making it necessary for her to obtain completion by another contractor at an increased cost.
 It is, of course, conceded that Owens violated the law when he executed the contract with Haslett and began work thereunder without first having procured a license. (Bus. & Prof. Code,  7028, 7030, 7031; Holm v. Bramwell, 20 Cal.App.2d 332, 335 [67 P.2d 114]; Loving & Evans v. Blick, 33 Cal.2d 603, 607 [204 P.2d 23].) It may be further stated that the contract was not validated so as to enable the plaintiff to sue upon it by his having procured such license during the course of the work, for the statute (Bus. & Prof. Code,  7031) declares that no person may bring or maintain any action for compensation for doing work for which a license is required without alleging and proving that he was duly licensed at all times during the performance of the contract. See, also, Restatement of the Law of Contracts, section 609, reading as follows:
 "A bargain that is illegal when formed does not become legal"
 "(a) by reason of a change of fact, except where both parties when the bargain was made neither knew nor had reason to know the facts making it illegal." (See, also, Teachout v. Bogy, 175 Cal. 481 [166 P. 319], Moffatt v. Bulson, 96 Cal. 106, 112 [30 P. 1022, 31 Am.St.Rep. 192].)
 It follows that the judgment of the trial court denying relief to Owens was correct, as, indeed, is impliedly admitted by his not having appealed therefrom.
 [1] However, a different situation exists as regards the appeal of Haslett from the judgment denying her relief on her *833 cross- complaint. Both Owens and Haslett were parties to an illegal contract and, as a general rule, to which there are exceptions, a party to an illegal contract can neither recover damages nor, by rescinding, recover the performance that he has rendered, or its value. The rule is thus stated in Restatement of the Law of Contracts, section 598:
 "A party to an illegal bargain can neither recover damages for breach thereof nor, by rescinding the bargain, recover the performance that he has rendered thereunder or its value, except as stated in Secs. 599-609."
 Reference is further made to the matter following the quoted section under the heading "Comment," including the statement that "The rule stated in the Section precludes recovery on principles of quasi-contract for benefits conferred under an illegal bargain, as well as an action on the bargain itself." This general rule has likewise been declared in many opinions rendered by the appellate courts of this state. See Takeuchi v. Schmuck, 206 Cal. 782, 786 [276 P. 345], wherein the court said:
 "It has long been a rule of law that courts will not compel parties to perform contracts which have for their object the performance of acts against sound public policy either by decreeing specific performance or awarding damages for breach. [Citing cases.] This rule is not generally applied to secure justice between parties who have made an illegal contract, but from regard for a higher interest--that of the public, whose welfare demands that certain transactions be discouraged." (See, also, Teachout v. Bogy, supra.)
 And in Loving & Evans v. Blick, supra, the Supreme Court said:
 "... It has been repeatedly declared in this state that 'a contract made contrary to the terms of a law designed for the protection of the public and prescribing a penalty for the violation thereof is illegal and void, and no action may be brought to enforce such contract' [citing cases]; and that 'whenever the illegality appears, whether the evidence comes from one side or the other, the disclosure is fatal to the case.' [Citing cases.]"
 [2] To this general rule there are certain recognized exceptions in favor of a party who is not in pari delicto with the other party to the contract and who, as the more innocent of the two, seeks recovery. One of these exceptions to the *834 general rule material here is stated as follows in section 599 of Restatement of the Law of Contracts:
 "Where the illegality of a bargain is due to"
 "(a) facts of which one party is justifiably ignorant and the other party is not, or"
 "(b) statutory or executive regulations of a minor character relating to a particular business which are unknown to one party, who is justified in assuming special knowledge by the other party of the requirements of the law, the illegality does not preclude recovery by the ignorant party of compensation for any performance rendered while he is still justifiably ignorant, or for losses incurred or gains prevented by nonperformance of the bargain."
 The conditions which must be met by one seeking recovery under the rule so stated is also covered in the Comment following the foregoing statement of the rule, under subsection b, as follows:
 "A party who is within the terms of Clause (a) or (b) at the time of the formation of the contract may discover before or during performance the facts that render the bargain illegal. Save in the exceptional cases stated in Secs. 600-604, he cannot recover for any performance rendered after the discovery. The same reason then bars him that bars recovery on a contract originally legal that subsequently before performance becomes illegal (see  608). If, however, on discovering the illegality, he renders no further performance, he can recover the same damages that would be recoverable for any wrongful breach of contract (see  329), provided, 1, that his non-performance is caused by illegality, and, 2, that the other party is not equally innocent. He is not freed from the ordinary requirement for the recovery of damages for breach of contract that a plaintiff who does not himself perform must establish that he could and would have performed except for the defendant's fault. Under the rule stated in the present Section illegality does not preclude recovery, but any other ground for denying recovery is still open." (Italics added.) (See, also, McAllister v. Drapeau, 14 Cal.2d 102 [92 P.2d 911, 125 A.L.R. 800].)
 If, therefore, as she claims on appeal, Haslett was not in pari delicto, if she was justifiably ignorant of the fact which made the contract illegal, that is, Owens' lack of license, then she could, on proper pleading and proof, have made her case come within the above exception to the general rule; for if she was not in pari delicto the illegality of the contract would not *835 have precluded her from recovering for losses incurred or gain prevented by nonperformance of the contract. But, to bring herself within this exception to the general rule, she was required to establish that at sometime during the performance of the contract she discovered the facts that rendered it illegal; that she ceased her performance because of this illegality; that she had up to that time in good faith performed the contract, and was ready, able and willing, but for the illegality, to continue to perform. These things are so because when relief is given to a party to an illegal contract who is not in pari delicto it amounts to a recognition of the contract by the court for the benefit of such a party and to prevent injustice; and the party whose plea for relief is thus entertained is faced with the usual and ordinary requirements exacted of any party who seeks recovery of damages for breach by the other party. While, as stated, the illegality of the contract does not preclude recovery in such case, any other ground for denying recovery is still open.
 [3] Applying these rules to the situation presented here, as gathered from the factual findings of the trial court, we find the following: In the beginning an illegal contract was made; it was illegal because of Owens' lack of license; being illegal when it was made, it did not become legal when Owens obtained his license during the progress of the work. Before she discovered the illegality of the contract, both Owens and Haslett had entered upon and were in the course of performance thereof; the house reached the stage of two-thirds completion and, up to that point, as to both material and workmanship that went into it, the house had been constructed in strict conformity to the contract; in that situation Owens requested further performance by Haslett, basing his request upon his faithful performance of the contract thus far; Haslett, basing her refusal, not upon illegality, but upon an untrue claim that he had not so performed, refused further payment; Owens thereupon ceased performance, basing that cessation, in turn, and justifiably insofar as the facts were concerned, upon Haslett's refusal to pay.
 When Owens sued her, neither party in the pleadings, either in the complaint, the answer or the cross-complaint, as originally filed, set up the illegality of the contract or sought to bring the pleader within any exception from the general rule that parties to an illegal contract can obtain no relief in the courts. But during the course of the trial the illegality developed, and if there was nothing further the court would *836 at that time have been justified in rendering judgment that neither take anything from the other, for under the general rule and in the absence of pleaded and proven exception, whenever the illegality appears, whether the evidence comes from one side or the other, the disclosure is fatal to the case. However, the trial court proceeded to take all the evidence which either party desired to produce, reserving all rulings, dependent upon illegality, until the close of the trial. Haslett sought and obtained from the court leave to amend her pleadings. Amendments were made, but again she did not plead illegality, and exception to the general rule permitting her to recover; she did not plead that she was not in pari delicto, and the record is barren of any testimony to that effect. But, over and beyond this, she neither pleaded nor proved, although seeking relief as for a breach of Owens' contract, that is, his failure to perform, that she herself had performed up to the time when performance by both parties ceased. True, there was evidence presented by her to the effect that she had ceased performance because Owens had not performed and on the contrary had breached the contract. But the evidence upon this subject was conflicting, the findings of the trial court were in favor of Owens and hence the record here stands that it was Haslett, not Owens, who had been guilty of breach. Haslett thus failed to bring herself within the exception permitting recovery to a party to an illegal contract who is not in pari delicto. This usual and ordinary requirement exacted of all persons who seek to recover upon a contract, that they themselves have kept the agreement, was not met by her and as a consequence she was not entitled upon the facts to any relief and the judgment of the trial court in denying such relief was correct.
 It is ordered that the judgment be affirmed.
 Adams, P. J., and Peek, J., concurred.
