
139 Cal.App.3d 195 (1983)
188 Cal. Rptr. 552
ORANGE COUNTY FOUNDATION FOR PRESERVATION OF PUBLIC PROPERTY et al., Plaintiffs and Appellants,
v.
IRVINE COMPANY et al., Defendants and Respondents; COUNTY OF ORANGE et al., Respondents.
Docket No. 24992.
Court of Appeals of California, Fourth District, Division One.
January 18, 1983.
*198 COUNSEL
Berry & Berry and Phillip S. Berry for Plaintiffs and Appellants.
George Deukmejian, Attorney General, N. Gregory Taylor, Assistant Attorney General, Peter H. Kaufman, Deputy Attorney General, Latham & Watkins, Joseph A. Wheelock, Jr., and Albert F. Shamash for Defendants and Respondents.
Adrian Kuyper, County Counsel, Arthur C. Wahlstedt, Assistant County Counsel, Terry C. Andrus, Deputy County Counsel, Michael H. Miller, City Attorney, and Robert H. Burnham, Assistant City Attorney, for Respondents.
OPINION
WORK, J.
In this case we hold public monies paid to compromise an invalid real property title claim, known to be baseless by the claimant, is not an expenditure for a public purpose, and constitutes a prohibited gift of public funds. Further, the constitutional bar to such "gifts" transcends the public policy favoring settlement of disputed claims, and permits the state to recoup such disbursements. Because we find the evidence discloses a triable issue of fact whether the Irvine Company's compromised title claims to certain islands were knowingly spurious, we reverse the summary judgment in its favor.


*199 Factual and Procedural Background

Claiming the State of California had made an unconstitutional gift (Cal. Const., art. XVI, § 6) and had wasted public monies (Code Civ. Proc., § 526a),[1] an association of taxpayers, the Orange County Foundation for Preservation of Public Property (Foundation) and others, sued the Irvine Company (Irvine) and the State of California (State) to set aside a settlement agreement resolving a dispute over title to three islands in upper Newport Bay (UNB) resulting in the payment of money to Irvine to clear the State's title to those properties. The Foundation alleged the islands were always tidelands and submerged lands protected by a public trust in which Irvine had no disputable interest.
Also sued was First American Title Insurance Company (First American) to recover under the policy it issued to the State in connection with the settlement agreement. First American's policy provided, if final judgment declared the disputed islands were always tidelands legally belonging to the State, First American would pay the State 90 percent of the settlement price. Coverage was for five years. The suit, filed within five years after the policy was issued, asked First American be required to pay that amount to the State under the policy.
Foundation also sought an injunction requiring the State Attorney General and Controller to recover the money allegedly owed to the State by Irvine and First American.
Finally, the County of Orange (County) and City of Newport Beach (City) were named by Foundation as "necessary and indispensable parties." The agreement which Foundation seeks to set aside provides for payment by Irvine to County and City of $1.65 million in taxes, and City and County were joint grantees of the three UNB islands.
The State demurred to the second amended complaint, claiming it stated no facts supporting a cause of action. These demurrers were sustained without leave to amend. City and County joined in the State's demurrer, and separately demurred on the ground Foundation's complaint sought no relief against them. These demurrers were also sustained without leave to amend. Irvine's and First American's motions for summary judgment were granted.

The Summary Judgment for Irvine
(1) One moving for summary judgment must show, by declarations or affidavits containing admissible facts, the claims or defenses of the adverse party *200 are entirely meritless and, lacking that showing, adverse parties need not demonstrate the validity of their claims or defenses by opposing documents. (Code Civ. Proc., § 437c; Rowland v. Christian (1968) 69 Cal.2d 108, 111 [70 Cal. Rptr. 97, 443 P.2d 561, 32 A.L.R.3d 496].)
Irvine claims its evidence shows Foundation cannot support its action under any theory. (2) It stresses the settlement of a good faith dispute between the State and a private party is an appropriate use of public funds, neither wasteful within the meaning of section 526a, nor a gift barred by article XVI, section 6, because the relinquishment of a colorable legal claim in return for settlement funds paid by the State is good consideration and accomplishes a valid public purpose. Although this is a correct statement of the law, it does not support the summary judgment for Irvine. The pleading alleges Irvine knew the three UNB islands in question were tidelands, and was aware it had no legal claim to them. If this allegation in Foundation's complaint is found true by the trier of fact, it will be sufficient to sustain a judgment in Foundation's favor against Irvine. "`[A] promise to compromise a claim utterly unfounded will not be regarded as a valuable consideration.' [Wharton on Contracts]." (City Street Improvement Co. v. Pearson (1919) 181 Cal. 640, 650 [185 P. 962, 20 A.L.R. 1317], overruled on other grounds in Hoffman v. City of Red Bluff (1965) 63 Cal.2d 584, 593-594 [47 Cal. Rptr. 553, 407 P.2d 857].) If Irvine knew the islands it was claiming in UNB were tidelands legally belonging to the State, its claim to title was in bad faith, and its relinquishment of that knowingly unfounded claim was inadequate consideration to support the State's obligation to pay money to Irvine.
Irvine argues public expenditures for a public purpose are not "gifts" within the meaning of article XVI, section 6, even though payment is made to a private party. This is correct, but there must be some real benefit to the State which constitutes the "public purpose" justifying the expenditure.
(3) "It is well settled that the primary question to be considered in determining whether an appropriation of public funds is to be considered a gift is whether the funds are to be used for a public or private purpose. If they are to be used for a public purpose, they are not a gift within the meaning of this constitutional prohibition. (County of Alameda v. Janssen (1940) 16 Cal.2d 276, 281 [106 P.2d 11, 130 A.L.R. 1141].) `The benefit to the State from an expenditure for a "public purpose" is in the nature of consideration and the funds expended are therefore not a gift even though private persons are benefited therefrom.' (Id., at p. 281.)
"Thus, in order for payment under the contracts here involved to constitute an appropriation of public money in violation of article IX, section 8 [prohibiting the expenditure of state funds for the support of private schools], the payment *201 must be without adequate consideration." (California Teachers Assn. v. Board of Trustees (1978) 82 Cal. App.3d 249, 257 [146 Cal. Rptr. 850], italics added.)
In California Teachers Assn. the court, analogizing article IX, section 8 with article XVI, section 6, found the expenditure in that case was supported by adequate consideration  i.e., the accomplishment of "a public purpose." However, our case presents this question: when is the consideration purportedly supporting the State's payment of funds so utterly lacking as to make the payment one which is, as a matter of law, not for a "public purpose," and therefore in violation of article XVI, section 6?
(4) Compromise of a wholly invalid claim is inadequate consideration to support a contract. (Union Collection Co. v. Buckman (1907) 150 Cal. 159, 164 [88 P. 708]; City Street Imp. Co. v. Pearson, supra, 181 Cal. 640, 649.) (2b) We hold that, when state funds are expended pursuant to a settlement agreement in exchange for the relinquishment of such a claim, no "public purpose" is achieved. Such an expenditure violates the gift clause.
Irvine's motion for summary judgment did not directly address the issue whether Irvine knew its claim to title in the UNB islands was invalid. Irvine thus did not meet its burden of proof to show no triable issue of fact (Murphy v. Allstate Ins. Co. (1978) 83 Cal. App.3d 38, 41 [147 Cal. Rptr. 565]). Irvine could not have met its burden even with a flat denial of Foundation's allegation because this would have left a disputed, triable issue. Since Irvine's knowledge of the validity of its claim could not be resolved by the pretrial papers before the trial court, it was error to grant Irvine's summary judgment motion.

The Summary Judgment for First American
First American relies on section 339 to support its summary judgment. That statute requires an action be brought within two years if "founded upon a contract, obligation or liability, evidenced by a certificate, or abstract or guaranty of title of real property, or by a policy of title insurance; provided, that the cause of action upon a contract, obligation or liability evidenced by a certificate, or abstract or guarantee of title of real property or policy of title insurance shall not be deemed to have accrued until the discovery of the loss or damage suffered by the aggrieved party thereunder." (Italics added.)
The part of the policy issued by First American and sued upon here, rather than guaranteeing the vendor can convey good title, guarantees the vendee did not already have good title. The parties argue at length whether this is "title insurance" within the meaning of section 339. (5) We need not determine that issue here, because even if the limitation of section 339 applies, the action was *202 brought within the period prescribed by the statute. There could not be any loss or damage recoverable against First American on the policy unless a court first found the UNB islands were tidelands. Thus, it is only when such a determination is made the statute of limitations begins to run. There has not yet been such a finding.
In the alternative, First American argues summary judgment was proper because no cause of action has yet arisen under which liability may be predicated under the policy terms. It relies on the specific language contained in indorsement C, as follows:
"6(a) The liability of the Company under this policy is as follows:
"(i) In the event there is a final judgment by a court of competent jurisdiction that the lands described as Parcels 2, 3 and 4 in Schedule C are sovereign tide or submerged lands and such lands are either held by the insured in its sovereign capacity ... then the liability of the Company shall be 90% of the full amount of this policy. In the event a portion of those lands ... are so held ..., then the liability of the Company shall be a proportionate amount of the total liability under this paragraph...."
However, there appears to be no reason why First American may not be made a party to this lawsuit which itself is asking for a declaratory "final" judgment upon which its liability is based.[2]

Demurrers by the State, the Attorney General and the Controller
(6) In addition to seeking refund to the State of money paid for the three UNB islands, Foundation sought an injunction compelling the State, and its officers, to seek recovery of the money the State allegedly gave away for no consideration, and/or recovery on the policy issued by First American.
In its demurring papers, the State relied largely on statutes of limitation. Foundation correctly states one of these, section 337, is inapplicable to its equitable action since it is not founded on written contract, but upon the statutory duties of these defendants.
The other, section 338, provides a three-year limitation for "[a]n action upon a liability created by statute...." Foundation argues persuasively its action is *203 based on a continuous statutory duty imposed on these defendants so, assuming arguendo section 338 applies to this action, the limitation period cannot have run. The defendants' statutory obligations exist now just as they existed at any time since the allegedly illegal payment of State funds.
On this appeal, the State chooses not to rely on a statute of limitations. Instead, it argues Foundation cannot require it to prosecute a suit against Irvine and First American, because only by proving the case against those defendants can Foundation prove the State's duty to bring suit. This is obviously true, so Foundation's action against the State is pointless, since this action can only succeed by a favorable conclusion of the lawsuit Foundation wants the State to prosecute. Foundation's appropriate remedy is to proceed as private attorney general, and it is not prejudiced by sustaining the demurrer in question because, if it obtains judgment against either Irvine or First American on behalf of the State, the State is duty bound to attempt to enforce the judgment.

Demurrers of City and County
Foundation named City and County in its complaint as "necessary and indispensable parties." City and County apparently felt otherwise and, in addition to joining in the State's demurrer, demurred on the ground no relief was sought against them. Since City and County choose not to be parties in this lawsuit, we see no reason to disturb the trial court's decision as to them.

Disposition
The demurrers granted to City, County, the State, the Attorney General and the Controller are affirmed. The summary judgments for Irvine and First American are reversed.
Brown (Gerald), P.J., and Staniforth, J., concurred.
A petition for a rehearing was denied February 9, 1983.
NOTES
[1]  All statutory references are to the Code of Civil Procedure unless otherwise specified.
[2]  The insurance contract provisions are susceptible to an interpretation its coverage term lapses unless final judgment is obtained by some entity within the five-year period. If so, the time has expired. However, First American did not raise this issue below, and we are obligated to review the summary judgments based on the issues presented to the trial court. (Rowland v. Christian, supra, 69 Cal.2d 108, 111.)
