
663 A.2d 574 (1995)
UNITED CAROLINA BANK
v.
Walter W. BEESLEY et al.
Supreme Judicial Court of Maine.
Argued June 8, 1995.
Decided August 15, 1995.
Matthew H. Herndon (orally), Verrill & Dana, Portland, for plaintiff.
*575 Daniel W. Mooers, Portland, Allen J. Hrycay (orally), Reef, Jordan & Hrycay, Portland, for defendant and parties-in-interest.
Before WATHEN, C.J., and ROBERTS, GLASSMAN, CLIFFORD, RUDMAN, and LIPEZ, JJ.
ROBERTS, Justice.
Parties-in-interest Walter W. and Barbara C. Beesley appeal from a judgment entered in the Superior Court (Cumberland County, Bradford, J.) on United Carolina Bank's complaint for foreclosure of its mortgage on a parcel of real estate in which they jointly held a one-half interest. The Beesleys contend that the court erred in (1) finding that United Carolina was entitled to be equitably subrogated to the rights of a prior mortgagee and entitled to an equitable lien on their one-half interest; (2) ordering a foreclosure on the entire property; and (3) failing to delineate the amounts owed by them to United Carolina pursuant to its equitable lien and the mortgage to which it was subrogated. Because we agree with the latter two arguments, we vacate the judgment.
The facts are not in dispute. In August 1983 the Beesleys' son Roger and his then wife Sharlene purchased as joint tenants a one-half interest in certain real estate in Westbrook. Walter and Barbara purchased the other one-half interest. All four owners joined in a mortgage of the property to Eastern Mortgage Company securing a loan in the amount of $38,350.
In May 1986 Roger and Sharlene applied for a loan from ComFed Mortgage Company. On the application, they indicated that they were the owners of the property and that they intended the proceeds of the loan to be used to discharge the Eastern mortgage. After obtaining approval, they gave a promissory note to ComFed in the amount of $59,996 secured by a mortgage on the property. The Eastern mortgage was satisfied by payment of $38,972, and the remaining proceeds of $15,419 were used for improvements to the property. Walter and Barbara were not parties to the ComFed note and mortgage. ComFed subsequently assigned the note to United Carolina.
In 1988, the four owners gave to The Money Store/Maine, Inc., a note in the amount of $30,700 secured by a mortgage on the property. The Money Store assigned the note and mortgage to Bay Loan & Investment Bank. Bay Loan does not claim that this loan is in default.
Roger and Sharlene defaulted on the ComFed note. In March 1992 United Carolina filed the present complaint for foreclosure against them in the Superior Court, also naming Walter and Barbara, Bay Loan, and The Money Store as parties-in-interest. Thereafter, Roger was discharged in bankruptcy, he and Sharlene divorced, and he acquired Sharlene's interest in the property pursuant to the terms of the divorce judgment. United Carolina and Walter and Barbara filed cross-motions for summary judgments. United Carolina argued that it should be equitably subrogated to the rights of Eastern with respect to the interests of Walter and Barbara.
Although the proceeding was labeled one for a summary judgment, the parties and the court treated it as though it were a trial on stipulated facts. After a hearing, the court entered a judgment of foreclosure against Roger and Sharlene.[1] Specifically, it found that United Carolina, as ComFed's assignee, was entitled to be equitably subrogated to the Eastern mortgage because ComFed had satisfied Walter's and Barbara's obligation pursuant to the Eastern mortgage. In addition, the court determined that United Carolina was entitled to an equitable lien on the property to the extent that the improvements to the property were made with proceeds from the ComFed loan. The court ordered United Carolina to amend its complaint to set forth its claim for equitable relief and ordered a further hearing to determine the amount of United Carolina's entitlement pursuant to these equitable claims.
After a hearing in June 1994, the court determined that United Carolina had a first priority mortgage and Bay Loan had a second *576 priority mortgage with respect to the one-half undivided interest now owned by Roger. The court determined that Bay Loan had the first priority mortgage and United Carolina had the second priority mortgage with respect to the one-half undivided interest owned by Walter and Barbara. The court found that the amount owed to United Carolina pursuant to the mortgage and lien totaled $95,339.17 as of March 31, 1994, plus additional interest, late charges, real estate taxes, insurance, other costs, and attorney fees accruing after that date. The court entered a judgment of foreclosure and sale of the entire property. Walter and Barbara appeal from that judgment.

I.

Equitable Subrogation and Equitable Lien
Equitable subrogation "is a device adopted by equity to compel the ultimate discharge of an obligation by him who in good conscience ought to pay it." Unity Tel. Co. v. Design Serv. Co., 160 Me. 188, 192, 201 A.2d 177, 179 (1964). The doctrine requires that the equities of the parties be weighed and balanced. Id. at 193, 201 A.2d 177.
Subrogation, itself a creature of equity, must be enforced with due regard for the rights, legal or equitable, of others. It should not be invoked so as to work injustice, or defeat a legal right, or to overthrow a superior or perhaps equal equity, or to displace an intervening right or title.
Federal Land Bank of Springfield v. Smith, 129 Me. 233, 238, 151 A. 420, 422 (1930). When a lender advances to a co-tenant money with which to discharge a mortgage on the common property, it is proper to apply the doctrine and to subrogate the lender to the discharged mortgage, even as against cotenants who were unaware of and did not authorize the transaction. See Annotation, One Advancing Money to Discharge Mortgage or Lien at Request of a Cotenant as Entitled to Subrogation to Encumbrance Discharged, 140 A.L.R. 1295, 1297-98 (1942). See also T.C. Williams, Annotation, Remedy of Mortgagee Who Loans Money in Good Faith for Purpose of Discharge of Valid Lien, as Affected by Failure of Mortgagor's Title, 151 A.L.R. 423, 436-38 (1944). In addition, a mortgagee who, in performing a title search, negligently fails to uncover an existing lien on the property is not precluded from the remedy of equitable subrogation. Federal Land Bank of Springfield, 129 Me. at 236-38, 151 A. at 421-22. We will not set aside equitable determinations by a trial court unless there is no competent evidence in the record to support them. See Aladdin Elec. Assocs. v. Town of Old Orchard Beach, 645 A.2d 1142, 1144 (Me.1994).
Contrary to the contentions of Walter and Barbara, there was competent evidence in the record to support the court's application of equitable subrogation. It is undisputed that Roger and Sharlene falsely represented that they owned the property when they applied for the mortgage now held by United Carolina. The proceeds from that mortgage were used to satisfy the indebtedness of all four owners secured by the Eastern mortgage. In essence, United Carolina paid a debt owed by Walter and Barbara. Therefore, the court did not err in concluding that equity and good conscience require that United Carolina be equitably subrogated to the rights of Eastern pursuant to the discharged mortgage.
The imposition of an equitable lien was likewise appropriate in this case. Walter and Barbara concede that the proceeds of the ComFed loan that were not needed to satisfy the Eastern mortgage were used to improve the property.[2] There is competent evidence to support the court's conclusion that it would be inequitable for Walter and Barbara to retain the benefit of those improvements without payment for their value. The court's imposition of an equitable lien was an appropriate remedy in these circumstances.

II.

Judgment of Foreclosure
Walter and Barbara argue that the judgment erroneously orders a foreclosure *577 sale, free and clear of Bay Loan's priority interest. We agree.
The foreclosure statute provides in pertinent part:
After breach of condition in a mortgage of first priority, the mortgagee ... may proceed for the purpose of foreclosure by a civil action against all parties in interest....
After breach of condition of any mortgage other than one of the first priority, the mortgagee or any person claiming under him may proceed for the purpose of foreclosure by a civil action against all parties in interest, except for parties in interest having a superior priority to the foreclosing mortgagee.... Parties in interest having a superior priority shall not be joined nor will their interests be affected by the proceedings, but the resulting sale under section 6323 shall be of the defendant or mortgagor's equity of redemption only.

14 M.R.S.A. § 6321 (Supp.1994) (emphasis added). The court found that United Carolina had a first priority mortgage on the one-half undivided interest now owned by Roger, but that Bay Loan had a first priority mortgage on the other half owned by Walter and Barbara. Because Bay Loan had a superior priority, the resulting foreclosure sale must be subject to Bay Loan's interest on this part of the property. On remand, the court should modify its judgment to order a foreclosure sale subject to Bay Loan's interest in one-half of the property.

III.

Delineation of Amounts Owed
We also agree with Walter's and Barbara's contention that the court erred in not separating the amounts they owed to United Carolina pursuant to the mortgage and the equitable lien. The mortgage and the mortgage foreclosure statute, 14 M.R.S.A. §§ 6321-6325 (Supp.1994), do not govern the equitable lien. By combining the equitable lien with the mortgage, the court erroneously applied the mortgage interest rate to the amount of the lien and permitted attorney fees related to the enforcement of the lien as provided in the mortgage foreclosure statute. The interest rate applicable to the equitable lien should be the statutory rate. 14 M.R.S.A. §§ 1602 to 1602-A (Supp.1994), Prejudgment interest should apply from the date of the original complaint as opposed to the amended complaint. See M.R.Civ.P. 15(c)(2). Although United Carolina is entitled to attorney fees on its equitable subrogation, there is neither an applicable statute nor an agreement with Walter and Barbara authorizing attorney fees on the equitable lien. The court, therefore, was without authority to award attorney fees related to the enforcement of the lien. See Top Line Distribs., Inc. v. Spickler, 525 A.2d 1039, 1040 (Me.1987).
We therefore remand the case to the Superior Court for a determination of the separate amounts owed by Walter and Barbara pursuant to the equitable lien and the mortgage to which United Carolina was equitably subrogated, and for the entry of an appropriate judgment of foreclosure.
The entry is:
Judgment vacated.
Remanded for further proceedings consistent with the opinion herein.
All concurring.
NOTES
[1]  The court also entered a judgment for United Carolina on Count II of its complaint against Sharlene as a co-maker of the ComFed promissory note.
[2]  There is no evidence in the record of the nature or value of the improvements to the property. Walter and Barbara, however, do not raise as error the court's valuation of the lien as equal to the amount of the proceeds from the ComFed loan not used to satisfy the Eastern mortgage.
