
670 A.2d 948 (1996)
James LYNCH
v.
George OUELLETTE, et al.
Supreme Judicial Court of Maine.
Submitted on Briefs January 18, 1996.
Decided February 7, 1996.
James P. Boone, Saco, for Plaintiff.
Stephen P. Beale, Skelton, Taintor & Abbott, Auburn, for Defendants.
Before WATHEN, C.J., and ROBERTS, GLASSMAN, CLIFFORD, RUDMAN, DANA and LIPEZ, JJ.
CLIFFORD, Justice.
James Lynch appeals from a summary judgment entered in the Superior Court (York County, Fritzsche, J.) in favor of George Ouellette and Sonia Ouellette on Lynch's complaint for the recovery of a $30,000 deposit he paid the Ouellettes as earnest money under a contract for the sale of real estate. Lynch contends that the trial court erred in granting the Ouellettes' motion for a summary judgment because he is entitled to a return of his deposit under the terms of the contract or, in the alternative, under an unjust enrichment theory. Finding no merit in Lynch's contentions, we affirm the judgment.
This matter arises from the following undisputed facts. On February 26, 1987, the parties entered into a purchase and sale agreement pursuant to which Lynch agreed to buy certain property owned by the Ouellettes at Old Orchard Beach. The original agreement provided that Lynch was to submit, in lieu of an earnest money deposit, an unconditional, irrevocable letter of credit in the amount of $30,000 within thirty days of the contract's execution. The agreement also provided that, in the event that a closing were not held by June 13, 1987, the Ouellettes would be able to draw $10,000 against the letter of credit; the remaining $20,000 could be drawn by them if no closing were held by June 30, 1987. Such sums were to be credited against the purchase price at closing. The contract expressly provided that the sums to be drawn by the Ouellettes against Lynch's letter of credit would be "unconditional" and "irrevocable," and would be made "regardless of whether a closing is. . . scheduled for any later date, or is subsequently *949 held; and if not held, regardless of whether such failure to close is attributable to [the] absence of any permits or approvals."
The last possible date for a closing under the contract was September 30, 1988. Lynch's obligation to close on the sale was contingent, however, on his ability to obtain permits and other approvals necessary for the construction of condominium units on the property. No closing was held by June 30, 1987. After Lynch failed to provide a letter of credit, the parties agreed that he would make a cash deposit of $30,000 in lieu of the letter. The parties agreed that the breach, the failure to provide the letter of credit, could be waived by Lynch's cash payment as well as his agreement to reimburse the Ouellettes for as much as $750 in additional legal fees they incurred as a result of Lynch's breach. Although Lynch eventually delivered the $30,000 deposit to the Ouellettes after failing to meet two successive deadlines, he did not pay the additional $750 in attorney fees. Lynch did not obtain the necessary permits and approvals for construction by September 30, 1988, the final deadline stipulated in the contract for the closing. The deadline never was extended, and no closing ever was held.
Lynch brought an action in the Superior Court to recover his $30,000 deposit from the Ouellettes. Lynch contends that his inability to secure the required approvals for construction excused him from any obligation to perform under the contract and entitles him to the return of his earnest money deposit. Both parties moved for a summary judgment. The court granted the Ouellettes' motion, denied Lynch's motion, and ordered the entry of a final judgment in favor of the Ouellettes on the complaint. This appeal followed.
We review the entry of a summary judgment for errors of law, viewing the evidence in a light most favorable to the party against whom the judgment was entered. Gilder v. Mitchell, 668 A.2d 879, 881 (Me. 1995). For a party to be entitled to a summary judgment, it must be determined that there are no issues of material fact and that the prevailing party is entitled to a judgment as a matter of law. Id.
The contract language at issue in this case is not reasonably susceptible to different interpretations, and therefore is not ambiguous. Devine v. Roche Biomedical Lab., Inc., 637 A.2d 441, 445 (Me.1994). When the language of a contract is not ambiguous, the contract's interpretation is a question of law for the court. F.O. Bailey Co. v. Ledgewood, Inc., 603 A.2d 466, 468 (Me.1992). Because the contract is unambiguous and there are no material issues of fact that are in dispute, the court properly addressed the motions for a summary judgment. Chadwick-BaRoss, Inc. v. T. Buck Constr., Inc., 627 A.2d 532, 534 (Me.1993).
"[T]he paramount principle in the construction of contracts is to give effect to the intention of the parties as gathered from the language of the agreement viewed in the light of all the circumstances under which it was made." Baybutt Constr. Corp. v. Commercial Union Ins. Co., 455 A.2d 914, 919 (Me.1983). In this case, both parties agree that there was a contract; that Lynch breached the contract by failing to timely provide a letter of credit as required in the agreement; that the contract would be reinstated so long as Lynch paid a $30,000 cash deposit in lieu of the letter of credit and agreed to reimburse the Ouellettes for $750 in attorney fees; that Lynch made the deposit but did not pay the Ouellettes' legal fees; that the necessary permits and approvals for construction were not obtained by Lynch; and that no extension of the contract ever was agreed to by the parties.
Lynch contends that he is entitled to a return of the $30,000 because his failure to pay the Ouellettes for the $750 in attorney fees, a condition necessitated by his failure to provide the $30,000 letter of credit, is not a material breach, and that the original contract was restored by the payment of the $30,000 deposit. Lynch's contention is unpersuasive. The original contractual provision regarding the $30,000 letter of credit was really in the nature of an option payment, i.e., although the $30,000 was to be credited toward the purchase price should there be a closing, the Ouellettes nevertheless *950 could retain the money unconditionally if there was no closing, without regard to whether any failure to close was due to Lynch's inability to secure construction permits.
Lynch breached the letter of credit provision, then sought to reinstate his rights under the contract by paying $30,000 in cash and an additional $750. Even were Lynch correct, and the failure to pay the $750 is not sufficiently material to prevent his rights under the original contract from being restored, he still would not be entitled to a refund of the $30,000 because, under the original contract, the $30,000 is nonrefundable. If, on the other hand, the failure to pay the $750 were material to the restoration of Lynch's rights under the original contract, and his rights were not so restored, the return of the $30,000 would place Lynch in a better position than if he had committed no breach at all. Despite Lynch's contention, the $30,000 was in the nature of a nonrefundable option. Although the money would have been credited toward the purchase price had Lynch purchased the property, Lynch did not buy the property and has not demonstrated any theory under which he is entitled to its return.
Lynch also contends that the Ouellettes would be unjustly enriched were they allowed to keep the deposit. We disagree. "Unjust enrichment describes recovery for the value of the benefit retained when there is no contractual relationship, but when, on the grounds of fairness and justice, the law compels performance of a legal and moral duty to pay." A.F.A.B., Inc. v. Town of Old Orchard Beach, 639 A.2d 103, 105 n. 3 (Me. 1994) (emphasis added) (citations omitted). The existence of a contractual relationship between Lynch and the Ouellettes precludes Lynch from recovery under an unjust enrichment theory. Top of the Track Associates v. Lewiston Raceways, Inc., 654 A.2d 1293, 1296 (Me.1995).
Judgment affirmed.
All concurring.
