
126 Cal.Rptr.2d 908 (2002)
29 Cal.4th 189
57 P.3d 372
CONSTRUCTION PROTECTIVE SERVICES, INC., Plaintiff and Appellant,
v.
TIG SPECIALTY INSURANCE COMPANY, Defendant and Respondent.
No. S099647.
Supreme Court of California.
November 14, 2002.
As Modified November 14, 2002.
*909 Superior Court, Los Angeles County; Michael B. Rutberg, Temporary Judge.[*]
Devirian & Shinmoto and Donald B. Devirian, Los Angeles, for Plaintiff and Appellant.
Selman Breitman, Alan B. Yuter and Rachel E. Hobbs, Los Angeles, for Defendant and Respondent.
Wiley, Rein & Fielding; Laura A. Foggan, John C. Yang, Alexander K. Sun; Sinnot, Dito, Moura & Puebla, Randolph P. Sinnott, Los Angeles, Randy M. Marmor, Oakland, for Insurance Environmental Litigation Association as Amicus Curiae on behalf of Defendant and Respondent.
Horvitz & Levy, Mitchell C. Tilner, Encino, and Karen Bray for Fire Insurance Exchange, Farmers Insurance Exchange, Truck Insurance Exchange and Mid Century Insurance as Amici Curiae on behalf of Defendant and Respondent.
Hancock Rothert & Bunshoft, W. Andrew Miller, William J. Baron and Kathryn C. Ashton, San Francisco, for London Market Insurers as Amicus Curiae on behalf of Defendant and Respondent.
BROWN, J.
Code of Civil Procedure[1] section 431.70 provides in pertinent part: "Where cross-demands for money have existed between persons at any point in time when neither demand was barred by the statute of limitations, and an action is thereafter commenced by one such person, the other person may assert in the answer the defense of payment in that the two demands are compensated so far as they equal each other, notwithstanding that an independent action asserting the person's claim would at the time of filing the answer be barred by the statute of limitations. If the cross-demand would otherwise be barred by the statute of limitations, the relief accorded under this section shall not exceed the value of the relief granted to the other party." In other words, section 431.70 permits a defendant in a civil action to assert a claim for relief in its answer and allege, in effect, that the defense claim constituted prior payment for the plaintiffs claim and therefore should be set off against any award in the plaintiffs favor.
In this case, the parties ask us to decide whether a comprehensive general liability insurance policy that obligates an insurer to defend and indemnify its insured against suits seeking damages thereby obligates the insurer to defend and indemnify the insured against a setoff claim asserted under section 431.70 in an answer. Included within this issue is the question of what exactly a setoff claim is and whether a setoff claim can result in affirmative relief against the plaintiff (as can a cross-complaint) or is limited to reducing the plaintiffs recovery. We conclude that a section *910 431.70 setoff claim cannot result in affirmative relief. This conclusion is contrary to the conclusion of the Court of Appeal, and because the Court of Appeal relied on this point in finding a duty to defend and indemnify, we find it appropriate to permit the lower courts to reconsider the scope of the insurer's obligations based on a correct understanding of section 431.70. As we shall explain, however, plaintiff has adequately stated a prima facie right to relief, and therefore the Court of Appeal was correct to reverse the trial court's order sustaining a demurrer. Accordingly, we affirm the judgment of the Court of Appeal, without adopting that court's reasoning.

I. Factual and Procedural Background
On review of an order sustaining a demurrer without leave to amend, we take as true the well-pleaded factual allegations of the complaint. (Haggis v. City of Los Angeles (2000) 22 Cal.4th 490, 495, 93 Cal. Rptr.2d 327, 993 P.2d 983.)
Construction Protective Services, Inc. (CPS) provides security at construction sites, and TIG Specialty Insurance Company (TIG Insurance) was, at relevant times, its general liability insurer. SHC/Mark Diversified (SHC) was the general contractor for construction at the Castlemont High School in Oakland, and it hired CPS to provide security at the construction site. On or about October 19, 1996, during the course of construction, a fire broke out at the construction site, causing damage to SHC's work. SHC refused to pay CPS, but the complaint does not make clear whether this refusal reflected dissatisfaction with CPS's services on account of the fire. On or about May 20, 1998, CPS brought an action against SHC to recover payment for services in the amount of $26,790. SHC asserted as an affirmative defense under section 431.70 that CPS was legally responsible for the damage arising out of the fire and therefore that SHC was entitled to set off fire damages against any amount it owed CPS for security services. The complaint does not explain why SHC asserted its claim by way of a section 431.70 setoff rather than a cross-complaint.
CPS tendered SHC's setoff claim to TIG Insurance, asking TIG Insurance to defend CPS against the claim. TIG Insurance refused the tender and stated that it would not provide CPS with a defense to the claim or indemnify CPS for any setoff that was ultimately awarded. CPS then employed its own counsel to oppose the setoff claim, and on or about April 29, 1999, it settled its dispute with SHC, receiving the sum of $20,000. The complaint does not relate how CPS and SHC arrived at the settlement amount, or what value these litigants gave to the setoff claim.
On February 10, 2000, CPS brought this action against TIG Insurance, alleging causes of action for breach of contract and breach of the covenant of good faith and fair dealing, and asserting that TIG Insurance should have defended CPS against SHC's setoff claim and indemnified CPS for the setoff amount. On May 22, 2000, the trial court sustained TIG Insurance's demurrer without leave to amend and dismissed the complaint. The trial court concluded that "under California law, an insurer does not have a duty to defend against affirmative defenses raised in response to an insured's complaint against another party." The Court of Appeal reversed, concluding that a liability insurer's duty to defend includes defense of setoff claims like the one at issue here. The court reasoned that the setoff claim constituted a suit under our definition of that term in Foster-Gardner, Inc. v. National Union Fire Ins. Co. (1998) 18 Cal.4th 857, 77 Cal.Rptr.2d 107, 959 P.2d 265 (Foster-Gardner) and that the claim could possibly *911 result in an award of damages against CPS. We granted review.

II. Discussion
CPS argues that TIG Insurance should not be able to avoid its contractual obligation to defend and provide liability coverage by the fortuity that SHC asserted its claim against CPS as a setoff rather than as a cross-complaint or an independent suit. In other words, if payment for security services had not been at issue and SHC had simply filed an action against CPS for damages resulting from the fire, the insurance policy would unquestionably have obligated TIG Insurance to defend that action and indemnify CPS. But because CPS happened to have a claim against SHC for unpaid services, SHC was able to assert its fire damages claim by way of setoff rather than a separate complaint. CPS asserts that this procedural nuance should not affect TIG Insurance's obligation as a liability insurer.
TIG Insurance, on the other hand, relies on the plain language of the insurance policy. The policy is not appended to the complaint, but the complaint alleges, and TIG Insurance concedes, that it is a comprehensive general liability policy obligating TIG Insurance to defend suits seeking damages. TIG Insurance argues that a setoff claim asserted in an answer is not a suit seeking damages, and it relies on our literal interpretation of the word "suit" in Foster-Gardner, supra, 18 Cal.4th at page 887, 77 Cal.Rptr.2d 107, 959 P.2d 265, where we stated that a "suit" is a "court proceeding initiated by the filing of a complaint." (Italics added.) TIG Insurance also points out that the insurance policy at issue here requires it to defend CPS in a "suit seeking ... damages." (Italics added.) TIG Insurance argues that SHC's setoff claim is not a "suit seeking ... damages," because, contrary to the Court of Appeal's holding, it could not result in an award of affirmative relief against CPS. Rather, it could only reduce the amount of CPS's recovery. In this regard, TIG Insurance cites section 431.30, subdivision (c), which provides: "Affirmative relief may not be claimed in the answer."
Because the Court of Appeal relied on its conclusion that a setoff under section 431.70 can result in an award of affirmative relief against the plaintiff, we focus on this question. We agree with TIG Insurance that relief by way of a section 431.70 setoff is limited to defeating the plaintiffs claim.
One important function of the section 431.70 setoff procedure is to provide partial relief from the statute of limitations. When two parties have opposing claims against one another, whether or not the two claims are related, one party might allow the statute of limitations to run on its claim, reasoning that the two claims have canceled one another out. If the second party then pursues its claim in a court action, the first party should be permitted to assert its expired claim defensively, arguing in effect that its earlier decision not to pursue the claim constituted a form of payment or compensation to the second party. But because the statute of limitations otherwise bars the first party's claim, the use of that claim should be defensive only, and the first party's recovery should be limited to offsetting any amount the second party might obtain on its opposing claim. The legislative history of section 431.70 suggests the Legislature intended the section to codify this principle.
Prior to July 1, 1972, former section 440 provided: "When cross-demands have existed between persons under such circumstances that, if one had brought an action against the other, a counterclaim could have been set up, the two demands shall *912 be deemed compensated, so far as they equal each other, and neither can be deprived of the benefit thereof by the assignment or death of the other." (Code Amends. 1873-1874, ch. 383, § 53, p. 300, italics added.) Notably, former section 440 said nothing about the statute of limitations, but a statute of limitations does not bar a defendant from alleging prior payment as a defense. Therefore, the statutory provision that "the two [cross-]demands shall be deemed compensated, so far as they equal each other" (ibid., italics added) suggested that the statute of limitations might not apply where a claim is asserted merely as a past payment rather than as a present cause of action. In Jones v. Mortimer (1946) 28 Cal.2d 627, 632-633, 170 P.2d 893 (Jones), we held just that.
Jones involved a setoff asserted by an insolvent building and loan association. (Jones, supra, 28 Cal.2d at p. 629, 170 P.2d 893.) Under applicable law, the association's shareholders were liable for the association's debts. (Id. at p. 630, 170 P.2d 893.) Therefore, the California Building and Loan Commissioner, who had taken over the insolvent association, levied an assessment against the shareholders of $100 per share. Jones owned four shares, so Jones's assessment was $400, but Jones never paid this assessment. Meanwhile, Jones had sued the association to recover for services, and he eventually recovered a judgment of $1,536.10 against the association and the commissioner. The commissioner had been paying the association's creditors at a rate of 50 cents on the dollar, so he determined to pay half the $1,536.10 judgment owed to Jones, or $768.05, but to deduct from this amount the $400 assessment levied against Jones, leaving a net of $368.05. Jones refused to accept the $400 setoff and brought a proceeding to enforce his judgment. (Id. at p. 629, 170 P.2d 893.)
We held that the $400 setoff was proper under section 440. (Jones, supra, 28 Cal.2d at p. 634, 170 P.2d 893.) In the course of our opinion, we rejected the argument that the $400 setoff claim was barred by the statute of limitations. (Id. at pp. 632-633, 170 P.2d 893.) We reasoned: "Defendant could have set up the assessment as a counterclaim [to Jones's original claim] when the two coexisted and there was no question about the statute of limitations on either claim. The next step [under section 440] is that the demands are compensated. That can mean nothing more or less than that each of the claimants is paid to the extent that their claims are equal. To the extent that they are paid, how can the statute of limitations run on either of them?" (Jones, at p. 633, 170 P.2d 893.)
Sunrise Produce Co. v. Malovich (1950) 101 Cal.App.2d 520, 225 P.2d 973 (Sunrise Produce) applied the holding of Jones to its own facts. In Sunrise Produce, the plaintiff sued for $3,850 in payment for goods sold to the defendant. The defendant admitted the allegations in the complaint but counterclaimed for $40,450 in unpaid trailer rentals (id. at p. 521, 225 P.2d 973), though the statute of limitations had run with respect to the trailer rental claim (id. at p. 522, 225 P.2d 973). The trial court granted the plaintiffs motion to strike the counterclaim and then granted summary judgment for the plaintiff. The Court of Appeal reversed, applying Jones. The court misstated the facts of Jones (Sunrise Produce, at p. 522, 225 P.2d 973) but correctly understood our holding in that case (id. at p. 523, 225 P.2d 973) and concluded, as we did in Jones, that the statute of limitations did not prevent the defendant from asserting payment as a defense. (Sunrise Produce, at pp. 523-524, 225 P.2d 973.) The court stated: "This is a fair rule as it provides in effect *913 that plaintiffs and defendant's claims, having coexisted in point of time, are deemed compensated to the extent that they equal each other, and the statutes of limitation should not bar the defendant's right to show that compensation." (Id. at p. 523, 225 P.2d 973.) The court further held that a claim need not be liquidated (that is, one having a fixed monetary value) in order for a defendant to allege the claim as a setoff. (Id. at pp. 524-525, 225 P.2d 973.)
The decision in Sunrise Produce might be read as permitting the defendant to collect the full $40,450 on its counterclaim, though that result would be inconsistent with the logic of Jones, which permitted the setoff defense but said nothing about allowing a defendant to obtain affirmative relief on a time-barred claim. Perhaps in part to clarify this question, the Legislature repealed former section 440 in 1971 (Stats.1971, ch. 244, § 43, p. 389) and enacted in its place section 431.70, codifying the rule of Jones and Sunrise Produce but adding the following sentence: "If the cross-demand would otherwise be barred by the statute of limitations, the relief accorded under this section shall not exceed the value of the relief granted to the other party." (§ 431.70, added by Stats. 1971, ch. 244, § 29, p. 386.) Section 431.70 has, in relevant part, remained unchanged since its enactment in 1971.
A legislative committee comment relating to the enactment of section 431.70 (reprinted at 14A West's Ann.Code Civ. Proc. (1973 ed.) foll. § 431.70, p. 413) cites Jones and Sunrise Produce and confirms that "Section 431.70 continues the substantive effect of former Code of Civil Procedure Section 440." Significantly, nothing in the legislative history of section 431.70 suggests the Legislature intended to permit defendants to obtain affirmative relief (that is, relief beyond defeating the plaintiffs claims) without filing a cross-complaint. Confusion, however, arises because of the following provision: "If the crossdemand would otherwise be barred by the statute of limitations, the relief accorded under this section shall not exceed the value of the relief granted to the other party." (§ 431.70.) This sentence suggests by negative implication that, if the crossdemand is not barred by the statute of limitations, a setoff claim can result in an affirmative award in the defendant's favor.
CPS, of course, adopts this reasoning in support of its position that the setoff claim at issue here constitutes a suit seeking damages, thereby triggering TIG Insurance's duty to defend, and the Court of Appeal in this case agreed with this argument. But this interpretation is in direct conflict with section 431.30, subdivision (c), which, as noted, states that "[affirmative relief may not be claimed in [an] answer." Because of the tension between these two provisions, a leading commentary on California procedure recommends that, where the cross-demand is not barred by the statute of limitations, a defendant should assert its claim by way of cross-complaint rather than relying solely on a setoff. (3 Cal. Forms of Pleading and Practice Ann. (2001) § 26.114[5], p. 26-104.)
We think the best reading of section 431.70 is that a setoff claim may only be used defensively, being in nature a defensive pleading asserting that the claim constituted prior payment for the amount sought in the plaintiffs complaint. Indeed, section 431.70 expressly refers to the setoff claim as "the defense of payment," and partial payment of Jones's judgment was the logic of our holding in Jones. (Jones, supra, 28 Cal.2d at p. 633, 170 P.2d 893.) One who has paid a liability in full or in part can allege that payment as a defense to a cause of action, but in that case the defendant merely hopes to defeat the plaintiffs complaint. If, in addition, *914 the defendant seeks affirmative relief in its favor (such as the recovery of damages), it must file a cross-complaint, because section 431.30, subdivision (c), bars it from claiming affirmative relief by way of the answer. (See Estate of Bell (1914) 168 Cal. 253, 258, 141 P. 1179.) Furthermore, to the extent a defendant seeks affirmative relief, the applicable statute of limitations applies to the defendant's claim, just as it would if the defendant were asserting its claim in an independent action. Therefore, when the Legislature limited the relief available under section 431.70, but only where "the cross-demand would otherwise be barred by the statute of limitations," it was not eliminating the requirement of filing a cross-complaint to obtain affirmative relief; rather, it was merely confirming the possibility of full relief where the statute of limitations imposes no bar.
We hold that a defendant may not obtain an award of affirmative relief against a plaintiff by way of section 431.70; rather, the defendant may only assert the setoff defensively to defeat the plaintiffs claim in whole or in part. This interpretation of the Code of Civil Procedure does not, however, resolve the question whether a setoff claim constitutes a suit seeking damages for purposes of a comprehensive general liability insurance policy. Though a defendant may not obtain affirmative relief by way of a setoff claim, the defendant does reduce the claim to a monetary value by successfully asserting it as payment for the liability the plaintiff is alleging in its complaint. And this point brings us back to the heart of CPS's argument. If not for the debt SHC owed to CPS, SHC's fire damages claim against CPS, if asserted in a court of law, would unquestionably have been a suit for damages. But because of its debt to CPS, SHC could allege the claim as a setoff rather than by way of complaint. For accounting purposes, however, the effect was no less a monetary recovery than would be a damages award. In these circumstances, CPS argues we should treat the setoff claim as a suit for damages.
We decline to decide this question in a case like this one where the precise terms of the insurance policy are not before us. Nevertheless, we affirm the judgment of the Court of Appeal. CPS's complaint adequately stated a prima facie right to relief, and therefore the Court of Appeal was correct to reverse the trial court's order sustaining the demurrer. In an action based on a written contract, a plaintiff may plead the legal effect of the contract rather than its precise language. (See generally 4 Witkin, Cal. Procedure (4th ed. 1997) Pleading, §§ 388, 389, 479, 480, 481, pp. 486-487, 572-574.) CPS has chosen to proceed in this manner, and though the complaint could have been clearer, it satisfactorily alleged (1) that the insurance policy obligated TIG Insurance to defend and indemnify CPS against suits seeking damages, and (2) that under the terms of the policy, SHC's setoff claim fell within the scope of that contractual obligation. Whether CPS can prove these allegations (that is, whether its interpretation of the applicable contractual language is correct in light of what we have said here) remains to be seen, but the allegations are sufficient to establish a prima facie right to relief. TIG Insurance may move for judgment on the pleadings or summary judgment, raising the same arguments it raised in its demurrer, and in support of its motion it may provide the court with a copy of the insurance policy in question.

III. Conclusion
The judgment of the Court of Appeal is affirmed.
*915 WE CONCUR: GEORGE, C.J. KENNARD, BAXTER, WERDEGAR, CHIN, and MORENO, JJ.
NOTES
[*]   Pursuant to California Constitution, article VI, section 21.
[1]  All further statutory references are to the Code of Civil Procedure unless otherwise indicated.
