
77 N.Y.2d 126 (1990)
In the Matter of New York State Medical Transporters Association, Inc., et al., Appellants,
v.
Cesar A. Perales, as Commissioner of the Department of Social Services of the State of New York, Respondent.
Court of Appeals of the State of New York.
Submitted November 14, 1990.
Decided December 20, 1990.
Daniel J. Roberts and Jeffrey M. Roberts for appellants.
Robert Abrams, Attorney-General (Michele M. Woodard, O. Peter Sherwood, Lawrence S. Kahn, Harvey M. Berman and Elizabeth Bradford of counsel), for respondent.
Chief Judge WACHTLER and Judges TITONE, HANCOCK, JR., and BELLACOSA concur with Judge KAYE; Judge ALEXANDER dissents and votes to reverse in a separate opinion in which Judge SIMONS concurs.
*128KAYE, J.
Petitioners, providers of nonemergency transportation services to Medicaid recipients, by this proceeding seek to compel respondent, Commissioner of the Department of Social Services (DSS), to process their claims for transportation services rendered to Medicaid recipients without the agency's prior approval. Petitioners acknowledge that prior agency approval is a statutory prerequisite but contend they are nonetheless entitled to have their claims processed because of an informal practice permitting them to obtain "retroactive prior approval" after the services were rendered, which respondent should either be estopped from contesting, or found to have ratified. In that there is no basis here for the application of estoppel or ratification, we affirm the order of the Appellate Division dismissing the petition.
By statute, DSS must provide Medicaid recipients with "transportation when essential to obtain care and services" (Social Services Law § 365-a [2] [j]). The statute requires that such transportation be "upon prior approval, except in cases of emergency," and the implementing regulation states that "[p]rior authorization by the local social services official shall be required for * * * transportation when essential to obtain medical care and services, except emergency care" (18 NYCRR 505.10 [b]).
Petitioner New York State Medical Transporters Association, Inc. is an association of companies that provide nonemergency invalid coach services to Medicaid recipients. Petitioner Medicab Inc. of New York was such a company during times relevant to this lawsuit, but was disqualified from further participation in the Medicaid program because its president pleaded guilty to grand larceny in connection with fraudulent Medicaid claims. Although a stipulation would have permitted Medicab's subsidiaries to resume services if certain conditions were met, Medicab's present status is unclear.
It is undisputed that under the applicable New York City plan, medical transporters were not themselves permitted to obtain the requisite approval. Instead, the medical care provider was to request approval from DSS's fiscal agent, a separate entity operating under contract with DSS. After approving *129 a request, the fiscal agent would assign a prior approval number to the claim, which the medical care provider would then communicate to the transporter and the transporter would include on its claim form. A prior approval number did not guarantee that a claim would be paid, only that it would be processed.
Monthly calls for prior approval reached 60,000 in 1986. Because the fiscal agent was unable to respond to that volume of calls, it adopted a practice of giving "retroactive prior approvals" after services had been rendered. The record does not establish when the fiscal agent adopted that practice, or how long it was maintained, or how many patients were transported, or when  prior to May 15, 1987  respondent learned of the practice.[1]
On May 15, 1987, respondent sent petitioner Association a draft letter restating the requirement that prior approval be obtained before transportation services were rendered in all nonemergency cases, and one month later sent the final version of the letter to all transportation providers in New York City. The letter reiterated that "[i]t is the policy of the New York State Medicaid Program that all requests for nonemergency ambulance and ambulette transportation be made via the telephone Prior Approval system at Computer Sciences Corporation (CSC) prior to or on the same date as the medical service." The letter further stated that the requirement of prior approval would be relaxed only when "extreme difficulty had been experienced by an ordering provider in getting through on the telephone to obtain a Prior Approval," and that such "retroactive prior approval" requests could in no event be made more than 30 days after the patient had been transported.
By this proceeding, petitioners then sought to compel respondent to reinstitute the prior practice, and also to process claims for transportation that had been provided without prior approval. They do not indicate how many claims are *130 involved, only that respondent denied one request made August 14, 1987 for "prior approval" of transportation provided to a patient in February 1986, and another request made June 27, 1987 for "prior approval" of transportation provided to eight patients in February 1985. While denying that portion of the petition seeking reinstitution of the practice, Supreme Court granted the petition to the extent it sought to compel processing of claims, on the ground that the DSS had "ratified the irregular procedure by its failure to end it within a reasonable time, and by its retention of the benefits resulting from petitioner's services." The Appellate Division reversed and dismissed the petition, concluding that there was no basis for the application of estoppel or ratification. We agree.
We have repeatedly made clear that estoppel cannot be invoked against a governmental agency to prevent it from discharging its statutory duties (Matter of Wedinger v Goldberger, 71 N.Y.2d 428, 441, cert denied 488 US 850; Matter of E.F.S. Ventures Corp. v Foster, 71 N.Y.2d 359, 369-370; Matter of Parkview Assocs. v City of New York, 71 N.Y.2d 274, 282, cert denied 488 US 801; Scruggs-Leftwich v Rivercross Tenants' Corp., 70 N.Y.2d 849, 852). Among other reasons, to permit estoppel against the government "could easily result in large scale public fraud." (Matter of E.F.S. Ventures Corp. v Foster, supra, at 370.) While we have not absolutely precluded the possibility of estoppel against a governmental agency, our decisions have made clear that it is foreclosed "in all but the rarest cases." (Matter of Parkview Assocs. v City of New York, supra, at 282.)
We reject petitioners' contention that this is such a case. First, nothing in this record suggests that the Appellate Division erred when it found that petitioners were well aware that the law required prior approval; thus, petitioners here are in an even weaker position than the petitioner in Parkview Assocs., which could have discovered the law by reasonable diligence (71 NY2d, at 282, supra). Second, we are not persuaded that the potential for public fraud is eliminated, as petitioners contend, because they seek only processing, not payment, of their claims. The possibility that collusive behavior will result if the government can be prevented from enforcing a law on the grounds that its agents excused compliance is the same, regardless of the immediacy of the expected benefit.
Finally, petitioners' claim that "manifest injustice" will *131 result if respondent is not compelled to process their claims has no foundation in this record, which does not even reveal how many claims are involved. Furthermore, the law is clear that those who deal with the government are expected to know the law, and cannot rely on the conduct of government agents contrary to law as a basis for "manifest injustice" claims (Parsa v State of New York, 64 N.Y.2d 143, 147; Heckler v Community Health Servs., 467 US 51, 63). "Men must turn square corners when they deal with the Government" (Rock Is., Ark. & La. R. R. Co. v United States, 254 US 141, 143). Thus, the Appellate Division correctly concluded that the doctrine of estoppel is not available to allow petitioners  who have only themselves to blame  to avoid the consequences of their own knowing failure to follow the law.
No doubt recognizing the difficulty of their estoppel claim, petitioners advance the closely related doctrine of ratification, contending that respondent knew of its agent's practice, accepted the benefits, and is therefore bound (see generally, 57 NY Jur 2d, Estoppel, Ratification, and Waiver, § 76). For much the same reason, that contention also must fail.
At the outset, ratification of an agent's acts requires knowledge of material facts concerning the allegedly binding transaction (see, e.g., Stauss v Title Guar. & Trust Co., 284 N.Y. 41, 45-47; Pollitz v Wabash R. R. Co., 207 N.Y. 113, 129-130; Reuschlein and Gregory, Agency and Partnership § 30, at 74; Restatement [Second] of Agency § 91 [1958]). Here, as the Appellate Division noted, there has been no showing that respondent knew of and intentionally condoned its agent's practice before its letters repudiating that practice. Nor does the record demonstrate that respondent retained benefits provided by petitioners. There was no evidence that the persons to whom transportation services were provided were Medicaid recipients or that that transportation was "essential to obtain care and services."[2]
But petitioners' arguments suffer from an even more fundamental flaw. Illegal contracts are not generally enforceable (Weir Metro Ambu-Service v Turner, 57 N.Y.2d 911, 912 [regulation]; *132 Tooker v Inter-County Tit. Guar. & Mtge. Co., 295 N.Y. 386, 390 [statute])  a rule that applies as well to ratification. A principal cannot ratify an agent's act that the principal itself could not have authorized (Restatement [Second] of Agency § 84 [2] [1958]; 6A Corbin, Contracts § 1532, at 806 [1962 ed]; 15 Williston, Contracts § 1786A, at 346 [3d ed 1972]; Reuschlein and Gregory, Agency and Partnership § 30, at 73).
Petitioners' argument is that respondent ratified its agent's act excusing compliance with the legal requirement that approval be obtained before transportation services are rendered. Neither the statute nor the regulation which imposes the requirement (Social Services Law § 365-a [2] [j]; 18 NYCRR 505.10 [b]) gives respondent discretion to excuse that legal requirement, and respondent thus could not ratify the fiscal agent's practice of excusing compliance with the law.
The argument of the dissent that this appeal involves social legislation, that should be humanely administered (dissenting opn, at 136), misses the mark. The issue here is not whether a statute should be humanely administered so that Medicaid recipients receive its intended benefit, but rather whether those who provide certain services to Medicaid recipients should be permitted to circumvent legislative measures that help to insure against fraud on the public. The methodology by which the statutory requirement of prior approval is to be implemented may be  as the dissent suggests  a policy decision, but the statutory requirement itself is not.
Our conclusion that ratification is not available to prevent respondent from enforcing the law here is entirely consistent with our decisions holding that the principle of estoppel is not available to petitioners for that purpose. The very reasons that the doctrine of estoppel are not available apply with equal force to petitioners' claims of ratification. If respondent could be prevented from enforcing the law on the ground that its agent had excused compliance, the possibilities for collusive behavior and large scale public fraud are not hard to imagine.
Indeed, this case demonstrates how difficult it would become to enforce the law if respondent could be prevented from adhering to legal requirements on the ground that its fiscal agent had excused compliance with the law. Petitioners' argument that respondent ratified the practice of "retroactive prior approvals" is based, in large part, on respondent's letters emphasizing that the legal requirement of prior approval meant exactly that. In other words, petitioner is relying on *133 respondent's efforts to enforce the law as the basis for its claim that respondent ratified a policy contrary to that law. Such a claim obviously cannot succeed.[3]
Accordingly, the order of the Appellate Division should be affirmed, with costs.
ALEXANDER, J. (dissenting).
Because, in my view, the record amply supports the conclusion that DSS ratified the acts of its fiscal agent with respect to the retroactive assignment of prior approval numbers, I would reverse the order of the Appellate Division and reinstate the judgment of Supreme Court. Therefore, I respectfully dissent.
In connection with the discharge of its statutory obligation to provide transportation services to Medicaid recipients, DSS delegated processing of payments for transportation services to its agent along with responsibility for issuing prior approval numbers which ensure that only medically necessary transportation services are provided to Medicaid recipients.[*] DSS gave its agent unfettered access to its computerized management database system (MMIS) and allowed the agent to process payments through that system without any control to ensure prior approval numbers had been assigned before services had been provided. These numbers were assigned upon telephone requests from medical providers and when in 1985 the volume of these telephone requests for prior approval numbers reached as high as 60,000 monthly, it became virtually impossible for medical providers to reach respondent's agent to obtain the prior approval number in advance of arranging for transportation with providers like petitioner.
DSS admits that in response to this crisis, which would have left Medicaid recipients without needed transportation in violation of DSS' statutory duty to provide such services, its agent devised a procedure to enable medical providers to arrange for these transportation services and then obtain the approval number. The agent designed a form and distributed it to providers to facilitate their use of the new policy and *134 that form served as input into respondent's MMIS. Petitioners have used that form and the process announced by the agent beginning in 1985. They have submitted and been paid claims based upon retroactive prior approval numbers issued in this manner by the agent. Moreover, petitioners have submitted logs that reflect that retroactive prior approvals were processed and numbers assigned by the agent as early as 1985 and as late as 1987.
DSS acknowledges that it gave the agent the capability to process payments directly through its system but claims it had no knowledge that its agent had implemented the revised process. However, in May 1987, DSS acknowledged that "it ha[d] become apparent by the number of written prior approval requests after the date of service, without any original prior approval information in our system" that its agent had been assigning prior approval numbers after services had been provided. Indeed DSS indicated that requests for nonemergency transportation services by a medical provider beyond 30 days from the date of the medical services "will no longer be accepted" as a valid request for transportation clearly implying that, to its knowledge, such requests had previously been accepted and processed. DSS does not contend that it lacked the capability to identify that information which existed in its own computerized files since 1985.
Petitioners argue that DSS should be estopped to deny the processing of their claims for reimbursement for the transportation services furnished or should be held to have ratified the acts of its agent in retroactively issuing prior approval numbers. Supreme Court concluded that DSS had ratified its agent's procedure for retroactively issuing prior approval numbers. The Appellate Division rejected this finding. That court concluded, and the majority agrees (see, majority opn, at 131) that the record was "devoid of any indication that the DSS knew of and thus intentionally condoned the acts of its agent" (160 AD2d 710, 712 [emphasis added]). Petitioners' estoppel arguments likewise were rejected.
Although reasonable minds may differ as to whether there is sufficient evidence in the record to support Supreme Court's finding that there had been an express ratification, in my view, the record clearly reflects sufficient evidence to demonstrate an implied ratification.
A principal's ratification of the acts of its agent may be express or implied (see, Reuschlein and Gregory, Agency and *135 Partnership § 33, at 76) and may be demonstrated by the words, acts or conduct of the principal. Moreover, the principal's acquiescence in the acts of its agent may constitute implied ratification when the principal accepts a benefit resulting from those acts (see, Pollitz v Wabash R. R. Co., 207 N.Y. 113, 119; Maloy v Montgomery, 246 App Div 482, 486, affd 272 N.Y. 630; Hedman v Security Tit. & Guar. Co., 245 App Div 224, 227); the acceptance of such benefit substitutes for the intent necessary to establish an express ratification (Reuschlein and Gregory, op. cit., at 76).
DSS acquiesced in the retroactive prior approval policy in processing transportation claims because it failed for at least a year and a half to take any action with respect to information contained in its own files (see, Pollitz v Wabash R. R. Co., supra, at 129; Matter of 54/55 Sixth Realty Corp. v Leventhal, 51 AD2d 714, 715, affd 42 N.Y.2d 935, 937; Matter of Minerva v Ward, 101 AD2d 754, 755, affd 63 N.Y.2d 739). Moreover, it is undisputed that DSS failed to place adequate controls over its MMIS to ensure that its agent processed claims properly.
The majority apparently rejects implied ratification because, in its view, DSS has not accepted a benefit as a result of its agent's policy. However, Supreme Court's undisturbed finding was that petitioner's provision of transportation services inured to DSS' benefit because it fulfilled its statutory obligation to provide those benefits. Social Services Law § 365-a (2) (j) and 18 NYCRR 505.10 (b) (1) require DSS to provide transportation services when medically necessary. The record clearly demonstrates that a number of these claims, based on retroactive prior approvals were processed and paid. In the posture of this case, where the hearing initially ordered by the Supreme Court was aborted by DSS' concession that its agent was indeed employing a procedure of retroactive prior approval, the fact that the record does not contain proof that transportation services provided prior to June 1987 were medically necessary should not redound to DSS' benefit. All agree that prior approval numbers ensure merely that a claim is processed rather than paid. Since it is the medical providers, not the transportation providers, who request transportation services, the medical necessity of the transportation is readily verifiable and will establish DSS' obligation to pay the claims.
The majority concludes, however, that in any event the subject contracts were illegal and therefore unenforceable. A contract for the provision of transportation services to Medicaid *136 recipients however is not illegal; indeed the service is expressly required by statute and regulation. The question is whether DSS' failure, through its agent, to provide prior approval numbers to petitioners in respect to medically authorized transportation prevents them from receiving payment for the services rendered on behalf of the State.
Where a statute requires performance of a function by a public officer in a specified manner, only substantial compliance with the statute is required to render the act valid (People ex rel. Lyon Co. v McDonough, 173 N.Y. 181, 190-191; Brown v Ward, 218 App Div 643, 645). A statute is not required to be literally performed; the focus is on whether the purpose of the statute is served (id.). Thus, whether respondent was required to issue prior approval numbers before transportation services were provided to Medicaid recipients depends on the over-all significance of the prior approval requirement contained in Social Services Law § 365-a.
Social legislation must be interpreted and enforced in a "reasonable and humane manner in accordance with its manifest intent and purpose" (Matter of Sabot v Lavine, 42 N.Y.2d 1068, 1069; see, Sawma v State of New York, 72 N.Y.2d 979, 980; O'Neill v Blum, 95 AD2d 357, 360-361). In this case, Social Services Law § 365-a (2) (j) and regulation 18 NYCRR 505.10 (b) (1) require the State to provide transportation services to Medicaid recipients "when essential to obtain medical care and services". Prior approval is required, except in emergency cases, to ensure transportation services are medically necessary before they are provided. Assignment of a prior approval number in response to a medical provider's transportation order, is but a method of demonstrating that the services were viewed as essential in advance of the provision of those services. Neither the statute nor the regulation define prior approval, state who is responsible for verifying prior approval, or indeed require the assignment of a prior approval number. That methodology was merely respondent's policy decision to satisfy the statutory prior approval requirement and while that methodology may be effective to reduce or eliminate the risk of fraud and may be viewed as a reasonable implementation of the statute at issue, there is no requirement that that method be viewed as the sole legal method of ensuring that transportation services are medically necessary. Such necessity exists because providers of medical services determine that transportation services are required and those providers are competent to make such determinations *137 in the first instance. That the policy of respondent's agent at issue here is not "illegal", is demonstrated by respondent's June 1987 memo "revising and enforcing" the prior approval policy and continuing the retroactive assignment of prior approval numbers for services provided within 30 days of the request. Surely the majority does not suggest that respondent's current policy is likewise illegal.
Although the State has a valid interest in preserving the fiscal integrity of the Medicaid program and preventing fraud and collusion, "[the] regulations [and statute] may not be applied with a literal rigidity that would effectively deny to eligible persons intended medical assistance" (Matter of Kaminsky v Brezenoff, 77 AD2d 550, 551, appeal dismissed 51 N.Y.2d 1009). The refusal to process these claims may ultimately redound to the detriment of the Medicaid recipients. I would reject the rigid application of the prior approval requirement under the particular circumstances of this case, and grant the petition herein to the limited extent of requiring respondent to process the rejected transportation claims (cf., Matter of Bryson v Blum, 97 AD2d 514, 515; O'Neill v Blum, 95 AD2d 357, 361, supra).
Order affirmed, with costs.
NOTES
[1]  The factual premise on which the dissent rests  that information concerning the "retroactive prior approvals" was in respondent's computer files beginning in 1985 (dissenting opn, at 133-134, 135)  lacks basis in the record. There is, for example, no evidence that the logs reflecting retroactive prior approvals by the fiscal agent (dissenting opn, at 134) were ever sent to respondent. Nor is there a factual predicate for the assertion that the fiscal agent's forms (which did not in any event reveal that there were any "retroactive prior approvals") were entered into respondent's computer (dissenting opn, at 134).
[2]  There is no "undisturbed finding * * * that petitioner's provision of transportation services inured to DSS' benefit" (dissenting opn, at 135). The Appellate Division reversed the trial court, and in so doing rejected its ratification analysis. Proof that respondent knew of the prior approval system and accepted the benefit of it is of course central to the dissent's position that there was an implied ratification.
[3]  The issue of whether respondent could authorize retroactive prior approvals if requested within 30 days of the provision of services (see, dissenting opn, at 137) is not before us, and we do not address it. Nor is there any basis here for the speculation that petitioners' voluntary provision of services without regard to the statutory requirement of prior approval could redound to the detriment of any Medicaid recipient (dissenting opn, at 137).
[*]  This assurance is secured by requiring the medical provider, rather than the transportation provider, to secure a "prior approval number" from DSS' agent.
