
664 P.2d 412 (1983)
295 Or. 98
Scott Jay CAMERON and Susan Marie Cameron, Petitioners On Review,
v.
James P. BENSON and Melba V. Benson, Respondents On Review,
v.
Safeco Title Insurance Company of Oregon, Respondent.
Nos. TC A7901-00080, CA 18573, SC 28685.
Supreme Court of Oregon.
Argued and Submitted September 8, 1982.
Decided June 1, 1983.
Rehearing Denied June 28, 1983.
*413 Ted M. Miller, Portland, argued the cause for petitioners on review. With him on the briefs was McCormick & Reynolds, Portland.
John S. Marandas, Portland, argued the cause for respondents on review. On the briefs was Gary J. Lekas, Portland.
Robert T. Scherzer, Portland, filed a brief in the Court of Appeals for respondent. With him on the brief was Wheelock, Niehaus, Hanna, Murphy, Green & Osaka, Portland.
Before LENT, C.J., and LINDE, PETERSON, TANZER, CAMPBELL and CARSON, Justices.[*]
CARSON, Justice.
Plaintiffs, as purchasers, brought this action for specific performance of a contract to convey real property. In the event that Defendants failed to specifically perform, Plaintiffs alternatively requested a judgment in the amount of the value of the real property less the unpaid balance on the contract. The trial court found that Plaintiffs were entitled to equitable relief and granted specific performance. In the alternative, upon the failure of Defendants to specifically perform within 60 days, the trial court awarded Plaintiffs a money judgment based on the value of the real estate at the time of trial. The Court of Appeals modified the money judgment, relying on the general rule that "[d]amages are measured as of the time of breach." Cameron v. Benson, 57 Or. App. 169, 643 P.2d 1360 (1982). We granted review to determine the appropriateness of the application of the general rule for measuring damages in a case such as this. We reverse.
As they relate to the issue before this court, the facts are uncomplicated. The parties, in May 1974, executed a contract for the sale of real property which required Defendants to deliver, upon the full payment of the purchase price, a "good and sufficient deed ... free and clear of all encumbrances." Four and one-half years later, in November 1978, Plaintiffs notified Defendants of their intention to pay the remaining balance on the contract and to receive the required deed and title insurance policy. A preliminary title report, ordered by Defendants in October 1978, disclosed recorded judgment liens against the property, as well as a mortgage lien executed by Defendants. The following month, Defendants sought another title report from a different title insurance company. The second title report failed to show the judgment and mortgage liens against the property. Defendants then purchased a policy of title insurance from the second company and tendered that policy, along with a bargain and sale deed, to Plaintiffs. Plaintiffs, aware of the contents of the first preliminary title report and believing that the contract required delivery of a warranty deed, rejected the tender and brought the instant action.[1]
The trial court found the equities to lie with Plaintiffs and gave Defendants 60 days to specifically perform the contract. The issue now before us  the time at which to measure the alternative money judgment  had its genesis in the following excerpt from the letter opinion issued by the trial court:
"I have reviewed the memoranda submitted by counsel in respect to the time *414 for the measurement of damages in the event the defendant does not specifically perform the contract as ordered by the court.
"It is the opinion of the court that the plaintiff is entitled to specific performance and this is the primary remedy to which the plaintiff is entitled. At the time of the trial there was evidence that the property had a fair market value at that time of $38,500.00. The defendant will suffer no loss by specifically performing. He will receive the entire benefits of his contract. He should not profit by his nonperformance." (Emphasis added.)
The trial court then entered the order granting specific performance and, in the alternative, a money judgment for Plaintiffs in the amount of the property's value at the time of the 1980 trial, $38,500, less the unpaid contract balance. Defendants appealed, contending that the award of damages should be based upon the value of the property at the time of their breach in 1978. The Court of Appeals agreed with Defendants on this point. The significance of the time at which the money judgment is measured to the present litigants stems from the fact that the property appreciated in value by $5,000 between Defendants' breach and the time of trial. Thus, the decree, as modified by the Court of Appeals to reflect the property's value at the time of the breach, effectively gives Defendants the option of conveying property worth $38,500 or retaining the property, paying the money judgment and "saving" $5,000.
Although no Oregon case has dealt specifically with the time for measuring an alternative or substitute money judgment where specific performance is granted as the primary remedy, there are some fixed judicial beacons to give us direction.
When a seller repudiates or totally breaches the contract, a purchaser has a choice of three remedies: "... he may treat the contract as at an end and sue for restitution, he may sue for damages, or he may sue for specific performance in certain cases [citations omitted]." Mohn v. Lear, 239 Or. 41, 48, 395 P.2d 117 (1964). Both the action for damages and the action for specific performance constitute a choice by the purchaser to affirm the contract and seek its enforcement. See, 17A C.J.S. Contracts § 523(1)(b), 1008 (1963).
The general principle underlying the remedy of damages is that the purchaser should receive an amount of money that would place him or her, as nearly as possible, in the same position as if the contract had been specifically performed as agreed. Crahane v. Swan, 212 Or. 143, 157, 318 P.2d 942 (1957) (citing Neppach v. Or & Cal R.R. Co., 46 Or. 374, 80 P. 482 (1905)); McCormick, Damages § 177, 680 (1935). The rule which applies this principle commonly is designated as "the loss of the bargain rule."
Should the purchaser seek damages when the seller breaches, he or she may recover the difference between the market value of the land and the contract price. Freedman v. Cholick, 233 Or. 569, 379 P.2d 575 (1963); Neppach v. Or & Cal R.R. Co., supra. In such case, the time at which damages are measured is analogous to the "general rule" in actions for damages in sales of personal property: The property's value at the time it should have been conveyed, i.e., the time of the seller's breach. Neppach v. Or & Cal R.R. Co., supra; see also 92 C.J.S. Vendor & Purchaser § 596, 649-50 (1955).
Likewise, when a purchaser seeks specific performance of a contract to convey real property but the trial court declines to grant specific performance, the measure of damages is said to be the same as that applied in an independent action for damages at law. 81A C.J.S. Specific Performance § 204, 180 (1977); see also, Livesley v. Johnston, 48 Or. 40, 53, 84 P. 1044 (1906). Thus, had the present case been an action for damages only or had Plaintiffs not been found to be entitled to the remedy of specific performance and awarded only damages, the application of the general rule of damages would not so persuasively be called into question.
*415 When a contract is one for the sale of marketable commodities, basing the measure of damages on the property's value at the time of breach coincides with and promotes the general policy of encouraging the injured party to avoid loss by making substitute arrangements. See, e.g., ORS 72.7130. Similarly, when the contract concerns real property and damages are sought rather than the equitable remedy of specific performance, the application of the general rule provides a predictable date at which to measure damages and likewise encourages the avoidance of losses. But, when specific performance is sought on a real property contract, the applicability of the general policy of encouraging the injured party to avoid losses is less clear. The choice of action itself is based on the plaintiff's determination that the property involved is "unique" and therefore not subject to substitution.
Defendants argue that the application of the general damage rule to this case is justified by the fact that their failure to perform did not occur at trial in 1980  it occurred when performance was requested, but not given, in 1978; and thus the earlier date is the time at which damages should be measured. Defendants ignore the fact that in this case Plaintiffs not only sought the equitable remedy of specific performance but were found by the trial court to be entitled to that performance as their primary remedy. The trial court's award of a money judgment, in the event that Defendants fail to perform as ordered, was a form of substitute relief. We therefore do not agree with Defendants that the general rule for measuring damages at law automatically applies to such case.
The general principle underlying equitable remedies (as opposed to law damages) is to grant such relief as will best accomplish the ends of justice. Patecky v. Friend, 220 Or. 612, 627, 350 P.2d 170 (1960); 81A CJS supra, § 188 at 143; 5A Corbin on Contracts § 1137, 97 (1964).
This court has recognized the power of a court to fashion equitable remedies based upon rules different from those applied for remedies at law. Thus, in Caveny v. Asheim, 202 Or. 195, 274 P.2d 281 (1954), where the purchasers sought specific performance of a contract to convey real estate free and clear of all encumbrances, this court modified the decree, giving the defendants the choice of performing the contract as agreed or partially performing and having a judgment against them in the amount of the existing lien. In response to the defendants' claimed limitations on a court in equity to award compensatory relief we said:
"By thus challenging the sufficiency of the complaint, [defendants] display a misconception of the nature of equitable compensation available to a vendee. They read equitable compensation, a species of substitute relief sometimes awarded in suits for specific performance, as synonymous with damages for breach of contract given in law. Although similar in character, they are not in fact identical remedies; they arise from different motives and are based upon different principles.
"We give heed to what is said in Pomeroy, Specific Performance of Contracts 3d ed., 902, § 436. It reads:
`"* * * relief of damages is only given in exceptional cases, and purely as ancillary to the equitable remedy, when the court had already obtained jurisdiction of the case by virtue of its equitable powers, and determines to do full justice to the party in one cause, instead of compelling him to commence a separate litigation in a court of law. `"Compensation,'" on the other hand, using the word in its special and restricted meaning, is an ordinary and constant incident of the remedy of specific performance, a part of the general course of administering the doctrines of equity, and is to be regarded, not as an independent and separate award of damages, but rather as a condition upon which the relief of specific performance is granted at all, or as a modification of that relief, so that it may be adapted to the circumstances of the case and the equities of the parties. Although the amount of compensation *416 may be ascertained upon somewhat the same basis as that upon which damages would be assessed for the same loss, yet the motives and principles upon which compensation is allowed are wholly different from those upon which damages are awarded. * * *'"
Caveny v. Asheim, supra at 217-18, 274 P.2d 281.
Defendants argue that the flexibility espoused in Caveny is specifically limited to cases involving equitable compensation, that is, where a plaintiff is awarded at least partial performance of the contract. They contend that the rule for measuring damages should not be different simply because a plaintiff, as here, seeks specific performance or damages at the same time. While we agree that the issue in Caveny, supra, involved compensation to make up for the lack of the defendants' full performance, that is not the only case where a rule different from that for damages at law should be applied.
As noted above, in an action seeking the equitable remedy of specific performance, it is the function of the court to do full and complete justice to the parties. With this principle in mind, the court requires broad discretion in framing its equitable remedies in order to adapt the relief to the circumstances of a particular case. See generally, Day v. Griffith, 283 Or. 393, 403, 584 P.2d 261 (1978); Stan Wiley v. Berg, 282 Or. 9, 21, 578 P.2d 384 (1978). But, the discretion of a court in equity is not unbridled. It is controlled and regulated by established equitable principles. Wittick v. Miles, 274 Or. 1, 6, 545 P.2d 121 (1976). Assuming adequate pleadings, there are essentially three remedies available once the court, in its discretion, determines that a plaintiff is entitled to specific performance. First, the court can simply award specific performance.[2] Second, the court can, as in Caveny, supra, award specific performance along with equitable compensation to make up for the difference between the agreed upon performance and that actually received. Finally, the court can, as the trial court did in this case, award specific performance as the primary remedy and also award an alternative money judgment should the defendant fail to perform within a set period of time. As with the value received when the court grants specific performance alone, we believe this alternative money judgment should be measured as of the time of the directed performance. See, e.g., 81A C.J.S. supra, § 188 at 144. Necessarily, the trial court's award of specific performance is based upon a finding that damages at law are inadequate; to base an alternative money judgment on damages at law would a fortiori be inadequate.
When Defendants breached the contract in 1978, Plaintiffs were faced with a choice of remedies. See, Mohn, supra. Plaintiffs chose to affirm the contract and, rather than accepting Defendants' repudiation and seeking damages, chose to seek specific performance. The trial court agreed that Plaintiffs were entitled to specifically enforce the contract. Thus, at the time of the trial court's decree, the contract at issue was still being treated as in existence and, conversely, Defendants' repudiation as ineffectual. It was not until Defendants chose not to abide by the trial court's primary remedy of specific performance that the contract was effectively repudiated. It logically follows that the money judgment be assessed in such a case by reference to the date that Plaintiffs and the trial court accepted repudiation, here the date when Defendants declined to follow the trial court's directed performance, rather than when Defendants first indicated their intent to repudiate.
To summarize, where an aggrieved purchaser of real property seeks, and is granted, the equitable remedy of specific performance, and the trial court also grants a requested money judgment in the event that the seller does not specifically perform, the general rule for measuring damages does not apply. In such a case, the time of performance is directed by the trial court and it is from this date of directed performance *417 that the substitute money judgment is to be computed rather than the time the seller initially repudiated the contract.[3] Here the property was valued at the date of the trial and this was sufficiently proximate to the date of directed performance to accomplish the ends of justice.
The modification of damages by the Court of Appeals is reversed and the award of the trial court reinstated.
NOTES
[*]  Tanzer, J., resigned December 31, 1982.
[1]  Understandably, with judgment and mortgage liens in excess of the value of the property in question, Plaintiffs did not seek specific performance with equitable compensation (frequently abatement of the purchase price) from Defendants for performance less than required by the contract.
[2]  We note that if the trial court deems it appropriate, it can complete the conveyance of the property by an appropriate decree, even in the absence of action by the seller. ORS 93.680. In this case, such remedy would have been inappropriate. See n. 1.
[3]  With respect to the time for measuring a money judgment when the primary remedy granted is specific performance, we find the following language relevant:

"Non-performance of duty of which the defendant has previously been guilty remains a breach of contract; and any subsequent non-performance that takes place in defiance of the court's decree will be a further breach of contract. The defendant's breach is only a partial breach of contract, if the court's decree is effective in compelling a delayed performance by the defendant. If the court's decree turns out to be wholly ineffective, the defendant's breach becomes a total breach after all, in spite of the efforts of the plaintiff and of the court; and in such a case damages or restitution for the total breach will surely be available as remedies in place of the one that proved to be ineffective." 5A Corbin on Contracts § 1222, 479 (1964).
