opinion of the Court.
¶ 1 Arizona Revised Statutes § 33-992(A) gives mechanics’ liens priority over liens recorded after construction begins on real property. We are asked to decide whether that statute precludes assignment by equitable subrogation of a lien that attached before construction began on the project at issue. We hold that it does not. Additionally, although a third party genеrally must discharge the entire lien obligation to qualify for equitable subrogation, when a single mortgage burdens multiple parcels, a third party
I. BACKGROUND
¶ 2 We view the evidence and its reasonаble inferences in the light most favorable to Appellants as the parties against whom partial summary judgment was granted. See Andrews v. Blake,
¶ 3 First National Bank of Arizona loaned approximately $62 million over time to The Summit at Copper Square, LLC to construct a high-rise commercial and condominium project in Phoenix. First National secured its initial loan of $44 million with a deed of trust against thе property in April 2005; eight months later it increased that loan by approximately $8 million, recording a modification to its deed of trust. First National recorded a second deed of trust in February 2007 to secure approximately $10 million in additional loaned funds. First National agreed with Summit to release condominium units from both deeds of trust upon payment of release prices set forth in the parties’ loan agreements as third parties purchased completed units. Our record does not contain the loan agreements, and nothing reflects how the release prices would be calculated.
¶4 The Weitz Company, L.L.C. was the general contractor for the project and began construction in November 2005. For nearly two years, Summit timely paid Weitz, which in turn paid its subcontractors and suppliers. As the project neared completion, however, Summit failed to pay Weitz approximately $4 million.
¶5 Beginning in September 2007, before the project was finished, Summit sold ninety-one completed condominium units to buyers who either financed their purchases or paid cash. Some of the purchase money for these units was applied to the construction loan, resulting in First National releasing these units from both its deeds of trust. Deeds of trust securing the owners’ purchase money loans were then recorded against the condominium units. The lenders required their deeds of trust to be in first-lien position as a condition for funding. Once the units were sold, they were treated as separate parсels of real estate. AR.S. § 33-1204(A).
¶ 6 In May 2008, after Summit had sold eighty-five of the ninety-one units at issue, Weitz recorded a mechanics’ lien against the project. Six months later, Weitz sued to foreclose its lien against Summit, the unit owners, and their lenders.
¶ 7 The owners and lenders (“Owners and Lenders”) contested the foreclosure and moved for partial summary judgment. They asserted that because they hаd paid the portions of the construction loan allocated to their units, they were equitably subrogated to First National’s April 2005 deed of trust and therefore had priority over Weitz’s mechanics’ lien.
¶ 8 The trial court agreed with Weitz’s alternative argument. The court then ruled that, because Weitz indisputably commenced work on the project before any units were sold, AR.S. § 33-992(A) gave Weitz’s mechanics’ lien priority. The parties subsequently allocated percentages of Weitz’s lien among the sold units, and the сourt entered judgment foreclosing Weitz’s lien against those units. Additionally, because Summit failed to pay its remaining obligation, First National’s successor-in-interest foreclosed on the unsold remainder of the project.
¶ 9 The court of appeals agreed that Weitz’s lien had priority, but for a different reason. It held that § 33-992(A) precludes application of equitable subrogаtion to give the Owners and Lenders lien priority over Weitz’s lien. Weitz Co. v. Heth, 233 Ariz.
¶ 10 We granted review because the interplay between § 33-992(A) and application of the equitable subrogation doctrine presents a legal issue of statewide importance. We have jurisdiction pursuant to Article 6, Section 5(3) of the Arizona Constitution and A.R.S. § 12-120.24.
II. DISCUSSION
A.
¶ 11 We review the trial court’s grant of partial summary judgment de novo. See Andrews,
B.
¶ 12 Arizona applies “equitable subrogation” as set forth in Restatement (Third) of Property: Mortgages § 7.6(a) (1997) (“Restatement”):
One who fully performs an obligation of another, secured by a mortgage, becomes by subrogation the owner of the obligation and the mortgage to the extent necessary to prevent unjust enrichment. Even though the performance would othеrwise discharge the obligation and the mortgage, they are preserved and the mortgage retains its priority in the hands of the subro-gee.
See Sourcecorp, Inc. v. Norcutt,
¶ 13 This case presents our first opportunity to address the interplay between equitable subrogation and the priority granted to mechanics’ liens by § 33-992(A), which provides, in relevant part, as follows:
The liens provided for in this article ... are preferred to all liens, mortgages or other encumbrances upon the property attaching subsequent to the time the labor was commenced or the materials were commenced to be furnished except any mortgage or deed of trust that is given as security for a loan made by a construction lender ... if the mortgage or deed of trust is recorded within ten days after labor was commenced or the materials were commenced to be furnished.
Until this case, our court оf appeals has consistently acknowledged the viability of equitable subrogation in the mechanics’ lien context. See Cont’l Lighting & Contracting, Inc. v. Premier Grading & Utils., LLC,
¶ 14 The court of appeals in this case did not address Northwest Federal Savings & Loan, and either distinguished its other decisions or rejected them as contrary to § 33-992(A). Weitz,
¶ 15 First, it misapprehends how equitable subrogation operates. When equitable subrogation occurs, the superior lien and attendant obligation are not discharged but are instead assigned by operation of law to the one who paid the obligation. Restatement § 7.6 cmt. a; see also United States v. Munsey Trust Co.,
¶ 16 Seсond, nothing in § 33-992(A) suggests that the legislature intended to preclude equitable subrogation in the mechanics’ lien context. The statute’s purpose is to protect the rights of laborers and material-men who enhance the value of property. Collins v. Stockwell,
¶ 17 Third, permitting equitable subrogation of a lien that is supеrior to a mechanics’ lien is consistent with the legislature’s treatment of junior lienholders’ interests in foreclosure actions. Section 33-723 provides that a junior lienholder “shall be entitled to an assignment of all the [superior lienholder’s] interest” by paying that person or entity the amount secured by the superior mortgages or deeds of trust together with interest and costs. Becаuse the statute makes no exception for an intervening mechanics’ lien, § 33-723 authorizes a junior lienholder to assume a superior lien position over any mechanics’ lien by discharging the superior lien. We have no reason to conclude that the legislature intended to preclude assignment of a superior lien by equitable subrogation in the mechanics’ lien сontext while permitting an assignment by statutory subrogation in a foreclosure action.
¶ 18 We hold that § 33-992(A) does not preclude equitable subrogation of a lien that is superior to a mechanics’ lien.
C.
¶ 19 Weitz alternatively argues, and the trial court agreed, that the Owners and Lenders cannot be equitably subrogated to First National’s April 2005 deed of trust because they did not fully discharge Summit’s obligation to First National, and Arizona does not permit partial equitable subrogation. The Owners and Lenders counter that because they paid Summit’s obligation as allocated to the sold condominium units and First National released those units from its deeds of trust, they have discharged their portion of the lien in full, and therefore partial satisfaction of the construction lоan does not preclude equitable subrogation.
¶ 21 We agree with the Owners and Lenders, however, that a prospective subrogee is required to discharge only the portion of an obligation that is secured by the property at issue. The complexities and equities attendant to dividing security between the original obligee and the subrogee do not exist when the original obligee has released its lien against the property. Cf. Dietrich Indus.,
¶ 22 We conclude that equitable subrogation of a mortgage is prohibited when it would divide security between the original obligee and a payor who discharges part of the obligation. But when the obligation is secured by a single mortgage on multiple properties and the obligee releases the property at issue from the mortgage lien in return for discharge of the entire obligation allocated to that property, equitable subrogation is permitted. Our holding is consistent with cases applying subrogation in the guarantor/ereditor context. See, e.g., W. Coach Corp. v. Rexrode,
D.
¶23 Weitz also argues that the court should not permit equitable subrogation becausе doing so would prejudice Weitz’s interests. See Sourcecorp,
E.
¶25 Finally, Weitz argues that it would not receive an unearned windfall by having first-lien priority because it built the condominium units and should be pаid for its work. The “windfall” sought to be avoided by equitable subrogation, however, does not relate to a lienholder’s entitlement to payment of the outstanding debt. Rather, the “windfall” addresses the equity of advancing a lienholder’s lien priority after a third party pays off a superior obligation. See Restatement § 7.6 cmt. a (“If there were no subrogation, ... junior interests would be promotеd in priority, giving them an unwarranted and unjust windfall.”).
¶ 26 That Weitz is owed money for completing the condominium units does not mean it is entitled to a promotion in lien priority. Cf. Sourcecorp,
III. CONCLUSION
¶ 27 Section 33-992(A) does not preclude equitable subrogation thаt results in the sub-rogee, through assignment by operation of law, obtaining lien priority over a mechanics’ lien. Accordingly, we hold that when a single mortgage is recorded against multiple parcels, a third party is not precluded from attaining equitable subrogation rights when it pays the pro rata amount of the superior obligation and obtains a full release of the parcel at issue from the mortgage lien. We therefore vacate the court of appeals’ opinion and reverse the trial court’s partial summary judgment. We remand to the trial court to decide whether equitable subrogation is appropriate in this case. The court should consider, among other things, whether equitable subrogation is needed to prevent Weitz from becoming unjustly enriched by a promotion in lien priority.
Notes
. Weitz conceded in the trial court that First National’s April 2005 deed of trust was superior to Weitz’s mechanics’ lien. But neither Weitz nor the Owners and Lenders addressed whether the December 2005 modification to the deed of trust had priority over Weitz’s lien, and we do not address that issue.
. Throughout this opinion, we use the terms "mortgage,'' “deed of trust,” and "lien” interchangeably.
