
577 P.2d 418 (1978)
91 N.M. 520
Jim DANLEY, Petitioner-Appellant,
v.
CITY OF ALAMOGORDO, a Municipal Corporation of the State of New Mexico, Respondent-Appellee.
No. 11665.
Supreme Court of New Mexico.
April 12, 1978.
*419 S. Thomas Overstreet, Alamogordo, for petitioner-appellant.
Steven K. Sanders, Alamogordo, for respondent-appellee.
Toney Anaya, Atty. Gen., John J. Duran, Asst. Atty. Gen., Santa Fe, for amicus curiae.

OPINION
SOSA, Justice.
Suit was brought in the District Court of Otero County for declaratory judgment on a contract between Danley (Contractor) and the City of Alamogordo (City). Stipulation of facts were filed and both parties moved for summary judgment. The court granted the City's motion and the Contractor appealed. We reverse.
The Contractor was developing a subdivision and in doing so he was going to lay a 6" water line which was adequate for the subdivision. Since the City's future plans would eventually require installing a 10" water line, the Contractor, at the City's request, installed the 10" water line in lieu of the smaller size. Through the actions of the city council, the City agreed to pay the additional material cost. However, when the Contractor presented the City with the bill ($6,623.34) it refused payment. All these facts were stipulated to and, additionally, the City stipulated that the supplementary cost incurred by the Contractor was reasonable.
In granting summary judgment for the City, the court stated in its order that the judgment was necessary since the City had not complied with the Public Purchases Act.[1]
The Public Purchases Act requires that all purchasing for local public bodies shall be performed by a central purchasing office designated by the governing authority of the user. § 6-5-21, N.M.S.A. 1953 (Repl. 1974). The Act further requires that all purchases by municipalities in the amount of $1,750 or more may be made only after solicitation of sealed bids. § 6-5-26(G), N.M.S.A. 1953 (Supp. 1975). Accordingly, it has been held that where the mode of contracting is especially and plainly prescribed and limited, that mode is exclusive, and must be pursued, or the contract will not bind the municipality. Fancher et al. v. County Com., 28 N.M. 179, 210 P. 237 (1921); Snyder v. Board of Education, 10 N.M. 446, 62 P. 1090 (1900).
Notwithstanding these cases, the appellant's point that equity should intervene is well taken.
While the authorities are not uniform, there is good authority to support the rule that where a contract is entered into between a municipality and another in good faith and the City has received benefits, it should not be allowed to retain them without paying the reasonable value of what it received.
Gamewell Company v. City of Phoenix, 216 F.2d 928, 940 (9th Cir.1954). Moreover, in Fargo Foundry Co. v. Village of Calloway, 148 Minn. 273, 181 N.W. 584 at 584 (1921), Annot., 33 A.L.R.3d 1164, 1184 (1970), the "general obligation to do justice which binds all persons, natural and artificial" was cited as the basis for permitting recovery by a contractor against a village on quantum valebant, notwithstanding the invalidity of the contract between them because of non-compliance with a bidding statute.
*420 The rationale for the rule is well stated in Village of Pillager v. Hewitt, 98 Minn. 265, 107 N.W. 815 (1906) which involved a city trying to recover money already paid to a contractor.
The defendant in good faith received the money and bonds in payment of the bridge which he had built for the plaintiff. The consideration for such payment was full and fair, and, in equity and good conscience, it ought to have been made by the plaintiff. Such being the case, it would be most inequitable and unconscionable to compel the defendant to return the money and bonds paid to him under the circumstances found by the trial court, and we hold that the plaintiff cannot maintain this action to recover them.
107 N.W. at 816.
Many cases which hold otherwise are distinguishable because they involve ultra vires, illegal or fraudulent contracts which the City could not enter into under any circumstances. City of Kiel v. Frank Shoe Mfg. Co., 245 Wis. 292, 14 N.W.2d 164 (1944); Ryan v. Thomas, 47 Ariz. 91, 53 P.2d 863 (1936); North Bergen Tp. v. Clinton Asphalt Co., 12 N.J. Misc. 22, 169 A. 818 (1933); City of Bangor v. Ridley, 117 Me. 297, 104 A. 230 (1918).
In the case at bar, the City stipulated that it induced the Contractor to substitute the more expensive 10" pipe in lieu of the 6" pipe the Contractor would have otherwise laid. This, coupled with the stipulation that the City agreed that the additional cost incurred by the Contractor for the replacement pipe is reasonable, leads us to the conclusion that it would be most inequitable to deny the Contractor his recovery for benefits conferred upon the City. Village of Pillager, supra.
We therefore hold that, absent fraud, a municipality may not retain benefits conferred upon it by a Contractor who was induced to perform work and who in good faith performed it for the City. Accordingly, the City, who dealt with the Contractor at arm's length, must be required to pay him for the additional material on a quantum valebant theory.
However, there appears to be an unanswered question of material fact. Where such issues of material fact exist, a summary judgment cannot be granted under N.M.R.Civ.P. 56(c) [§ 21-1-1(56)(c), N.M.S.A. 1953 (Repl. 1970)]. Runyan v. Jaramillo, 90 N.M. 629, 567 P.2d 478 (1977). Inasmuch as the City alleges that it informed the Contractor that the pipe would have to be purchased by the City, the trial court should make a factual determination on this point. If it is true, it would limit the Contractor's requested recovery since as the maxim states, "he who comes into equity must come with clean hands." See New York Football Giants, Inc. v. Los Angeles Chargers Football Club, Inc., 291 F.2d 471 (5th Cir.1961). Should the trial court find that the Contractor wilfully failed to comply with the City's alleged instructions, the Contractor's recovery would then be limited to the price he would have paid for the 6" pipe.
Whereas the summary judgment was improvidently granted, this cause is reversed and remanded to the trial court for a determination as to the outstanding issue of material fact and to otherwise decide the matter consistent with this opinion.
EASLEY and PAYNE, JJ., concur.
NOTES
[1]  §§ 6-5-17 et seq., N.M.S.A. 1953 (Repl. 1974).
