The Presbyterian Home, Inc., (Presbyterian) provides nursing home services to Medicaid patients in Georgia for which it is reimbursed through a contract with the Georgia Department of Medical Assistance (DMA). By letter dated April 2, 1985, Presbyterian was notified by the DMA that, as the result of a decision of the Grant Appeals Board of the U. S. Department of Health and Human Services disallowing federal reimbursement for certain payments the DMA had previously made to Presbyterian, Presbyterian would be required to refund the DMA $167,591.59. The DMA subsequently recouped this amount through withholdings against current medical assistance reimbursement payments to which Presbyterian would otherwise have been entitled. The DMA’s decision in this regard was sustained on appeal to an administrative hearing officer and to the DMA Commissioner but was reversed by the Brooks County Superior Court based on a determination that Presbyterian had accepted the payments in question in “good faith reliance” on prior decisions of the DMA and had “materially changed its position [in] reliance on such” decisions, such that it would be inequitable to require it to make restitution.
The disputed payments were made to Presbyterian for services *886rendered to Medicaid patients July 1, 1981, through October 31, 1982. At the beginning of that period, Presbyterian was classified by the DMA as a “hospital-based” facility as opposed to a “free-standing” facility, which meant that it was entitled to reimbursement at a higher rate than would otherwise have been the case. On November 19, 1981, the DMA notified Presbyterian in writing that, beginning December 1, 1981, it would no longer be classified as a hospital-based facility. Presbyterian appealed this decision administratively and on February 18, 1982, was notified by the DMA Commissioner that it was being reclassified as a hospital-based facility retroactive to December 1,1981. Subsequently, however, the DMA amended its regulations, effective November 1, 1982, to implement a more restrictive definition of the term, “hospital-based facility.” Although Presbyterian did not qualify as a hospital-based facility under this new definition, the regulations specified that homes which were already classified as hospital-based would remain so until November 1, 1983. Thus, Presbyterian continued to receive medical assistance payments from the DMA at the hospital-based rate through that date.
In May of 1984, the DMA was notified by the Health Care Financing Administration of the U. S. Department of Health and Human Services that the federal funding it had received for the additional medical assistance payments it had made to Presbyterian for the period from July 1, 1981 through October 31, 1982, based on the latter’s classification as a hospital-based facility during that period, was being disallowed retroactively, based on a determination that Presbyterian had not met the federal requirements for a hospital-based facility during that period. After unsuccessfully appealing this decision to the Grant Appeals Board of the U. S. Department of Health and Human Services, the DMA sent Presbyterian the refund demand notice which gave rise to the present litigation. As previously indicated, the refund demand involved only those payments made to Presbyterian from July 1, 1981 through October 31, 1982. No refund was sought for the period from November 1, 1982 through November 1, 1983.
The DMA contends that the superior court erred in ruling that Presbyterian had so changed its position in reliance on its hospital-based classification during the period in question that it would be unjust to require it to refund the monies in question because: (1) This ruling constituted a de novo factual determination which the court, sitting as a court of review, lacked the authority to make; (2) there was no evidence in the record to support such a determination; and (3) the parties’ obligations were, in any event, governed by a written contract, thus rendering the application of restitutionary principles inappropriate. Held:
1. Generally speaking, “[p]ayments of claims made through igno*887ranee of the law or where all the facts are known and there is no misplaced confidence and no artifice, deception, or fraudulent practice used by the other party are deemed voluntary and cannot be recovered unless made under an urgent and immediate necessity therefor. . . .” OCGA § 13-1-13. This rule is, however, qualified by the equitable principle that “[r]elief may be granted even in cases of negligence by the complainant if it appears that the other party has not been prejudiced thereby.” OCGA § 23-2-32 (b). See Gulf Life Ins. Co. v. Folsom, 256 Ga. 400, 405 (349 SE2d 368) (1986).
While the parties’ contract specified that “the Department shall make no reimbursement for any claim, or portion thereof, for which federal financial participation is not available,” it was silent on the subject of what would happen if federal financial participation were disallowed retroactively after such reimbursement had already been made. Clearly, what the state was asserting under these circumstances was not an express right under its contract with Presbyterian but rather an implied contractual right to the return of monies paid by mistake in connection with that contract. Cf. Matthews v. Neal, Greene & Clark, 177 Ga. App. 26, 28 (1) (338 SE2d 496) (1985).
“ ‘There can be no doubt of the state’s right to a refund of money paid out through mistake under the time-honored and well recognized principle that one may not retain money or goods which have come into his hands through mistake and which he is not, in good conscience, entitled to retain. (Cits.)’ [Cit.] However, ‘ “(t)he equitable right to restitution from one unjustly enriched at another’s expense is terminated or diminished if circumstances have so changed that it would be inequitable to require full restitution.” [Cit.]’ [Cit.]” State of Ga. Dept. of Admin. Svcs. v. Pritchett, 160 Ga. App. 294 (287 SE2d 290) (1981). Based on the application of these principles, we hold that the superior court was correct in its conclusion that the DMA would be estopped from recovering the overpayments it had made to Presbyterian to the extent that the latter had changed its position in reliance on its hospital-based classification in such a manner as to make such restitution inequitable.
2. While the Administrative Procedure Act provides that “[t]he court shall not substitute its judgment for that of the agency as to the weight of the evidence on questions of fact,” it further specifies that “[t]he court may reverse or modify the decision if. substantial rights of the appellant have been prejudiced because the administrative findings, inferences, conclusions, or decisions are: ... (4) Affected by [an] error of law; [or are] (5) [c]learly erroneous in view of the reliable, probative, and substantive evidence on the whole record. . . .” OCGA § 50-13-19 (h). Cf. Stevens v. Bd. of Regents, 129 Ga. App. 347 (199 SE2d 620) (1973).
It is apparent from the record in this case that the DMA has *888never attempted to refute Presbyterian’s contention, advanced both before the administrative hearing officer and before the superior court, that it materially changed its position in reliance on the hospital-based classification assigned to it by the DMA. Instead, the DMA has consistently taken the position that this issue is irrelevant because its refund claim is grounded on an express contractual right rather than on restitutionary principles. Indeed, in a memorandum to the State Law Department outlining the agency’s reasons for its appeal of the 1984 U. S. Department of Health and Human Services decision disallowing federal reimbursement for the payments in question, the DMA’s deputy commissioner adopted Presbyterian’s position on the detrimental reliance issue, stating: “We further believe that the equitable doctrine of promissory estoppel would apply to Presbyterian. Through no fault of their own, and subsequent to budgeting, planning and fund raising efforts, Presbyterian relied on its classification by the Department as hospital-based. Presbyterian had every right to rely on the Department’s cost report instructions, and its classification, and did so properly rely on such to its detriment. To now reverse its classification would be a miscarriage of justice.”
Given this admission by the DMA’s deputy commissioner, combined with the lack of any evidence tending to refute Presbyterian’s contention that it relied to its detriment on the hospital-based classification assigned to it by the DMA, we hold that the superior court was authorized to conclude as a matter of law that the DMA was es-topped from recovering the funds in question.
Judgment affirmed.
McMurray, P. J., Birdsong, P. J., Pope and Beasley, JJ., concur. Sognier, C. J., Carley, Cooper and Andrews, JJ., dissent.