
652 N.W.2d 139 (2002)
William O. OPPERMAN and Debra J. Opperman, Appellees,
v.
ALLIED MUTUAL INSURANCE COMPANY, Appellant.
No. 01-0887.
Supreme Court of Iowa.
October 9, 2002.
John B. Grier and Merrill C. Swartz of Cartwright, Druker & Ryden, Marshalltown, for appellant.
Jay A. Nardini of Nardini Law Office, Cedar Falls, for appellees.
LARSON, Justice.
William and Debra Opperman sued their insurance carrier, Allied Mutual Insurance Company, under the underinsured-motorist coverage of their policy. The district court entered judgment for the plaintiffs, and Allied appealed, claiming error in the court's computation of interest. We modify and affirm.

I. Facts and Prior Proceedings.

William Opperman was injured in an automobile accident on December 18, 1995. *140 On December 9, 1997, he and his wife sued Sara Pruisner and Cynthia Gitch, drivers of separate automobiles, claiming the negligence of each was a proximate cause of the accident. On October 5, 1998, the plaintiffs amended their petition to add Allied as a party. The claim against Allied was severed from the claims against Pruisner and Gitch. The Oppermans settled with Sara Pruisner for the full amount of her insurance limits, $25,000, and released her. Meanwhile, Allied paid approximately $5000 in medical benefits. The Oppermans' suit against Gitch proceeded to trial in March of 1999. The jury returned a verdict of no fault in favor of Gitch.
Trial of the Oppermans' suit against Allied followed. The suit was a hybrid one: the plaintiffs sued their insurer, Allied, under the underinsured-motorist provision of their policy  a contract action. See Vasquez v. LeMars Mut. Ins. Co., 477 N.W.2d 404, 410 (Iowa 1991). However, the measure of damages would be determined under tort principles: what would have been the plaintiffs' recovery against Pruisner if Pruisner were liable for plaintiffs' damages. See Houselog v. Milwaukee Guardian Ins., 473 N.W.2d 52, 55 (Iowa 1991).
The jury returned a verdict for the Oppermans for $41,763.61 in past damages and $3000 in future damages. The judgment was reduced by $25,000 for the amount the Oppermans had received from Pruisner's carrier, for a net judgment of $19,763.61, including both past and future damages. The court added interest on the past damages of $16,763.61 from the date of the filing of the petition against Pruisner and Gitch and interest on the future damages of $3000 from March 9, 2001, the date of the jury verdict against Allied. On March 23, 2001, Allied paid the Oppermans $14,763.61, after taking credit for approximately $5000 it had already paid in medical benefits.
On April 23, 2001, the Oppermans asked the court to clarify its ruling with regard to interest. Allied responded with its calculation of interest. At the hearing, the court ruled in favor of the plaintiffs and entered judgment against Allied for past damages in the amount of $17,243.55 with per diem interest to accumulate from March 16, 2001. Judgment was also entered against Allied for future damages of $3000 with per diem interest from the date of judgment.
Allied's underinsured-motorist provision stated:
We will pay all sums which an "insured" is legally entitled to recover as compensatory damages from the owner or operator of an "underinsured motor vehicle" resulting from "bodily injury" to any person caused by an accident.
The amount the plaintiffs were "legally entitled to recover" was set by the jury in the Oppermans' suit against Allied. The jury's verdict assessed damages to which the Oppermans' were entitled, as follows:


Past medical expenses                 $16,763.61
Future medical expenses                     0.00
Past loss of full mind and body         5,000.00
Future loss of full mind and body           0.00
Past physical and mental pain and
  suffering of William Opperman        10,000.00
Loss of consortium for Debra
  Opperman                             10,000.00
Total past damages                     41,763.61
Future damages                          3,000.00

Under Iowa Code section 668.13(1) and (4), the plaintiffs would have been entitled, in a tort suit against Pruisner, to interest from the date of the filing of their petition for past damages and from the date of the judgment as to future damages. It is true the jury did not add interest to the past damages, but interest may be properly computed and ordered by the court as additional damages to be included in the judgment. See Indep. Sch. Dist. *141 No. 65 v. Stafford, 208 Okla. 542, 257 P.2d 1092 (1953). In Stafford,
[t]he [trial] court ... found plaintiff had asked interest upon her claim but the jury had failed to allow this item, although plaintiff was entitled thereto, and accordingly entered judgment for interest....
Id. at 1094. The court's addition of interest was assigned as error on appeal by the defendant. The court concluded "we are of the opinion that the trial court properly added the interest to the jury verdict [based on statute providing for interest on damages certain]." Id. at 1095; see also 47 C.J.S. Interest & Usury § 22, at 65 (1982):
Where the trial court has instructed the jury that any recovery should have interest thereon but the jury fails to include such interest, the trial court may add interest to the jury's verdict. Also, where the amount of damages assessed in a verdict is reduced, interest may be added to that part of the verdict for which judgment is entered, unless the order granting the option clearly excludes the right to interest.
The interest that plaintiffs were entitled to recover on their tort claim was governed by Iowa Code section 668.13. As provided in that statute, that interest should date from the filing of their petition in the tort action. Under Iowa Code section 668.13(3), interest is to be computed daily
at a rate equal to the coupon issue yield equivalent, as determined by the United States secretary of the treasury, of the average accepted auction price for the last auction of fifty-two week United States treasury bills settled immediately prior to the date of the judgment plus two percent. The state court administrator shall distribute notice monthly of that rate and any changes to that rate to all district courts.
The complexity of this interest calculation, which ordinarily would be made after the verdict and prior to the judgment, makes it obvious that the court, not the jury, must determine and add the amount of interest. The jury sets the damages, the Code dictates interest to be added to it, and the court does it. We believe it makes no difference whether the damages have been set by a jury in a direct tort action or in a hybrid action, such as this, in which the suit against the insurer measures the amount of recovery the plaintiffs would have realized in an underlying tort action.
In the plaintiffs' petition, they requested interest on the damage awards "as provided by law."

II. Prejudgment Interest on the Tort Judgment.

Iowa Code section 668.13 provides the commencement date and the rules for the determination of interest:
Interest shall be allowed on all money due on judgments and decrees on actions brought pursuant to this chapter, subject to the following:
1. Interest, except interest awarded for future damages, shall accrue from the date of the commencement of the action.
. . . .
3. Interest shall be calculated as of the date of judgment at a rate equal to the coupon issue yield equivalent, as determined by the United States secretary of the treasury, of the average accepted auction price for the last auction of fifty-two week United States treasury bills settled immediately prior to the date of the judgment plus two percent. The state court administrator shall distribute notice monthly of that rate and any changes to that rate to all district courts.

*142 4. Interest awarded for future damages shall not begin to accrue until the date of the entry of the judgment.
5. Interest shall be computed daily to the date of the payment, except as may otherwise be ordered by the court pursuant to a structured judgment under section 668.3, subsection 7.
Our review of the interest issues is for error at law. Wilson v. IBP, Inc., 589 N.W.2d 729, 730 (Iowa 1999). Allied argues the prejudgment interest awarded against it should not be computed from the date the original petition was filed against the tortfeasors but only from the date Allied was brought into the case approximately ten months later. Allied relies on Mossman v. Amana Society, 494 N.W.2d 676 (Iowa 1993). That case is inapposite. Mossman involved a defendant who was brought in by impleader after the original suit was commenced. We held prejudgment interest would not commence until that party was brought into the case. Id. at 678. Mossman was not an underinsured-motorist case in which the added party stepped into the shoes of the underinsured motorist as we have in this case. Here, the insurance company is liable for all interest the tortfeasor would owe and, under Iowa Code section 668.13, that would begin to accrue when the action was filed against the original tortfeasor. The commencement of interest does not turn on when Allied was brought into the litigation.
It is true, as Allied claims, that a claim against an insurance company for underinsured-motorist insurance benefits is a claim under a contract. See Vasquez, 477 N.W.2d at 410. Allied argues that the initial suit by the Oppermans was a tort suit, and when the amended petition was filed adding Allied to the case, this for the first time inserted a contract action in what had been a purely tort action. It cites Baumler v. Hemesath, 534 N.W.2d 650, 656 (Iowa 1995), in which we said: "When monetary damages arise from distinct new claims made in an amended petition, we allow interest on the judgment only from the date plaintiff filed its amended petition." Baumler is distinguishable because that case involved damages for two distinct accidents  not, as in this case, a suit under a contract to ascertain the insurance benefits, as established under tort principles.
We reject Allied's argument on this point. Allied bound itself under its insurance policy to pay its insured what the insured would have recovered against a third party if that party had been adequately insured. By statute that includes interest on past damages from the date the tort suit was filed. Houselog, 473 N.W.2d at 55. Allied distinguishes Houselog on the basis there was a judgment in that case against the tortfeasor, while in the present case there was no judgment against the tortfeasor; rather the amount of damages sustained by the plaintiffs was established in a suit against the insurance company. This is a distinction without a substantive difference, however, because the issue in both cases is what it would take to fully compensate the plaintiffs for the damages they suffered. In both cases, the amount of prejudgment interest would be determined by the court in accordance with Iowa Code section 668.13.

III. Computation of Interest.

Iowa Code section 535.3(1) provides for interest on all judgments and decrees at a rate to be calculated according to Iowa Code section 668.13(1). As already noted, that section provides that interest shall accrue from the date of the commencement of the original action. The concept of prejudgment interest is based on the realization that the loss caused by tortious conduct results in the loss of use *143 of compensatory damages, and to make the plaintiff whole, prejudgment interest should be allowed. See Wilson, 589 N.W.2d at 732. Iowa Code section 668.13(4) provides that interest on future damages shall not begin to accrue until the date of the judgment.
Several payments were received by the plaintiffs before they obtained a judgment against Allied. These payments included payments by Allied for medical expenses and one payment by Pruisner's liability insurance company in settlement of the claim against Pruisner. The amounts and dates of payment are as follows:


 February 23, 1999    $25,000.00 in settlement from
                                 Pruisner's insurer
 April 9, 1996        $    28.00 in medical payment
 July 24, 1996        $   168.07 in medical payment
 October 7, 1996      $   264.12 in medical payment
 June 29, 1998        $  1238.31 in medical payment
 July 20, 1999        $  3000.00 in medical payment

In computing the interest to be paid by Allied, the plaintiffs should receive interest on all of the past damages from December 9, 1997, the date the original petition was filed against the tortfeasors, to March 16, 2000, when judgment was entered against Allied. As each payment set out above was received by the plaintiffs, the amount of principal on which interest was computed should be reduced by those amounts as of the time the payments were received. All payments credited to Allied shall first be credited to the interest then due and the balance, if any, to principal. See 47 C.J.S. Interest & Usury § 74, at 164 (discussing the general rule, which is known as the "United States rule," to apply payments first to interest, and the balance, if any, to principal); see also Christensen v. Snap-On Tools Corp., 554 N.W.2d 254, 262 (Iowa 1996).
The plaintiffs argue that these credits should be made at the time judgment was entered, not as of the time the payments were actually made, and the district court agreed. That is so even though the plaintiffs had received those payments at earlier times. On the other hand, Allied argues that credits should be figured as of the time interest began to accrue, i.e., the date of filing the original suit, even though the plaintiffs did not receive the payments until later. Thus, Allied would get credit for payments before they made them. We disagree with both parties and the district court and conclude that interest should be computed only on the remaining unpaid balance of the past-due damages after each payment was received. The amount of prejudgment interest thus computed is part of plaintiffs' damages in the contract action. This amount should be added to the other damages found by the jury and made a part of the total damages awarded in the judgment. This aggregate award shall, in turn, draw interest from the date of judgment at the rate specified in Iowa Code section 535.3(1).[1]
As modified, we affirm the judgment of the district court.
AFFIRMED AS MODIFIED.
NOTES
[1]  We recognized in Schimmelpfennig v. Eagle National Assurance Corp., 641 N.W.2d 814, 815 (Iowa 2002), that section 535.3 incorporates by reference the rate of interest provided in section 668.13, but does not incorporate the provision of section 668.13, which provides that interest shall accrue from the date of the commencement of the action. Consequently, the aggregate judgment, which includes interest on the past tort damages, computed pursuant to section 668.13, only draws interest from the date that the judgment is entered.
