On October 8,1993, Progressive Consumer Federal Credit Union (“Progressive”), plaintiff-appellant, filed a complaint against the Internal Revenue Service (“the government”), defendant-appellee, in the Land Court Department of the Trial Court of Plymouth County, Commonwealth of Massachusetts. Progressive sought a declaration that its mortgage had priority over properly recorded federal tax liens. The government filed a notice of removal pursuant to 28 U.S.C. § 1444, removing the action to the United States District Court for the District of Massachusetts. The district court entered a memorandum and order granting the cross-motion of the United States for summary judgment oh May 26,1995, holding that Progressive’s mortgage was not entitled to priority over the federal tax liens under the Massachusetts common law doctrines of equitable subrogation or unjust enrichment.
The mortgage at issue is secured by real property located in Marshfield, Massachusetts. In 1987, as owners of the property, Jeremiah and Deborah Folkard (“the Fol-kards”) executed a $150,000.00 mortgage note which was properly recorded in favor of the Miles Standish Federal Credit Union (“MSFCU”). Between 1988 and 1990, the government recorded six notices of tax liens on the Folkards’ property for unpaid federal taxes. The total amount of the liens, exclusive of interest accrued since recording, was $94,560.93. In 1990, the Folkards refinanced their mortgage debt, then $130,905.55, with MSFCU, executing a new note and mortgage to secure a debt of $142,000.00. At the time of this transaction, MSFCU was presumably unaware of the existing tax liens. The 1987 mortgage was discharged at the moment the new mortgage was recorded on November 26, 1990. This resulted in priority of the federal tax liens, because of their recording dates, over the new mortgage. On October 19,1992, MSFCU assigned its interest in the 1990 note and mortgage to Progressive. The record does not reflect when Progressive became aware of the record priority of the federal tax liens over its mortgage.
I. JURISDICTION
The threshold issue to be decided in this case, whether the district court properly exercised subject-matter jurisdiction over Progressive’s claim, was raised for the first time on appeal. The government argues that the district court lacked jurisdiction on two grounds: (1) the government has not waived its sovereign immunity and therefore cannot be sued; and (2) the Declaratory Judgment Act, 28 U.S.C. § 2201(a), specifically bars the relief requested.
1
Lack of subject-matter jurisdiction can be raised at any point during litigation. There can be no doubt of our power and duly to decide the issue.
See Bender v. Williamsport Area School Dist.,
A. Waiver of Sovereign Immunity
It has long been established that the United States is not subject to suit without a waiver of sovereign immunity, and that any such waiver is to be strictly construed.
Nickerson v. United States,
*1231 Under section 2410, the government waives its sovereign immunity in both quiet title and foreclosure actions. See 28 U.S.C. §§ 2410(a)(1), (2). A party bringing a foreclosure under this section, however, must seek a judicial sale of the underlying property. 28 U.S.C. § 2410(c). We begin by discussing whether Progressive’s claim of priority constitutes a quiet title action within the meaning of 28 U.S.C. § 2410(a)(1).
The Scope of Quiet Title Actions Under 28 U.S.C. § 2410(a)(1)
The government contends that Progressive’s claim does not fall within the coverage of section 2410(a)(1) because its claim of priority is not a quiet title action within the meaning of the statute. It follows, argues the government, that because no judicial sale has taken place, there can be no waiver of sovereign immunity and hence Progressive cannot maintain its cause of action. We disagree for the reasons that follow.
Section 2410(a)(1) has never been read to incorporate the formalistic distinctions state law pleading rules.
United States v. Coson,
[U]nder existing law there is no provision whereby the owner of real estate may clear his title to such real estate of the cloud of a Government mortgage or lien_ In many instances persons acting in good faith have purchased real estate without knowledge of the Government lien or in the belief that the lien had been extinguished.... It appears that justice and fair dealing would require that a method be provided to clear real estate titles of questionable or valueless Government liens.
H.R.Rep. No. 1191, 77th Cong., 1st Sess. 2 (1941); S.Rep. No. 1646, 77th Cong., 2d Sess. 2 (1942).
The government points out that, under Massachusetts law, a plaintiff must have both actual possession and legal title to maintain a quiet title action, see
MacNeil Bros. Co. v. State Realty Co. of Boston, Inc.,
If, in substance, the relief the plaintiff sought here — a declaration of the priority of Progressive’s mortgage over the government’s tax lien — is congruent with the relief available in a quiet title suit, it would frustrate congressional intent to block plaintiffs access to relief. Congress, after all, was
*1232
concerned not with the niceties of common law pleading, but with practical problems facing owners whose property was encumbered by government liens. What label the. state has attached to the cause of action is a helpful but not determinative guide to the proper interpretation of the federal statute.
See Harrell v. United States,
The government, however, contends that the relief that Progressive seeks would not have been available in a quiet title action. Progressive does not seek to remove the government’s lien as invalid, but rather to establish the priority of its own mortgage over the concededly valid federal tax lien. Such rehef would not have been available in a traditional quiet title action, only in a foreclosure action, where valid but junior liens are extinguished in favor of a senior hen. It follows, argues the government, that because no judicial sale has taken place, see § 2410(c), there can be no waiver of sovereign immunity-
A careful reading of the authorities, however, does not support the government’s narrow portrayal of the rehef available to quiet title plaintiffs. The government principally relies on
Kasdon v. G.W. Zierden Landscaping, Inc.,
Unlike the plaintiffs in
Kasdon,
Progressive seeks only a determination of priority between competing hens; it never initiated a foreclosure action and did not seek to extinguish the federal hen. The
Kasdon
court cited
United States v. Morrison,
[W]e think that section 2410, an integral part of the Judicial Code rather than an administrative mechanism of the tax structure, establishes a specific jurisdiction for these suits as bills to quiet title or for foreclosure of the private lien. The jurisdiction does not depend on the specific rehef sought, [e.g.] foreclosure. Rather it rests on the existence of the traditional controversy in which a private party asserts an ownership [interest] which is superior to the claimed hen of the United States government. (Quoting United States v. Morrison,247 F.2d 285 (5th Cir.1957).
Other courts have adopted this logic. In
Brightwell v. United States,
[While] [traditionally, actions to quiet title have sought determinations of who owns particular property, ... [u]nder federal law, the definition is somewhat broader; a party may maintain a quiet title action against the United States when the government asserts that a federal tax hen exists against the property, 28 U.S.C. § 2410(a), and thus hen priority disputes have been considered “quiet title” actions [for the purposes of section 2410].
These cases undercut the government’s contention that a quiet title action is appropriate under section 2410(a)(1) only where the plaintiff seeks a decree that the government’s lien is defective or invalid and seeks to have the cloud removed from his title. In support of its position, the government primarily relies on
Raulerson v. United States,
The Declaratory Judgment Act and Section 2410
In the alternative, the government argues that even if we were to hold that the district court has jurisdiction to hear Progressive’s claim, the Declaratory Judgment Act (“the Act”), 28 U.S.C. § 2201(a), nonetheless bars the court from granting the relief requested. The Act provides,
inter alia,
that a federal district court has the authority to grant declaratory relief “[i]n a case of actual controversy within its jurisdiction, except with respect to Federal taxes....” 28 U.S.C. § 2201(a). A claim challenging the power of the IRS to assess and collect taxes is barred by the Act.
McCarthy v. Marshall,
Similarly, “[w]hen a federal tax lien is involved, ... an action pursuant to section 2410(a) will not lie if its sole purpose is to challenge the validity of the underlying assessment.”
Johnson v. United States,
Progressive’s claim in no way contests the legitimacy of the government’s tax assessment or the taxpayers’ liability. It follows that “[s]ince the quiet title action specifically mandated by section 2410 is in substance a suit for a declaratory judgment,” the Declaratory Judgment Act will not operate as a wrench to deprive the district court of its jurisdiction in this case.
Aqua Bar & Lounge Inc. v. U.S.,
In summary, because we conclude that the government waives its sovereign immunity under 28 U.S.C. § 2410(a)(1), and that the Declaratory Judgment Act poses no bar to the rehef sought, we accordingly hold that the district court properly exercised subject-matter jurisdiction over Progressive’s claim.
II. THE MERITS
We now turn to the substantive issue on appeal: whether Massachusetts law entitles Progressive’s mortgage priority over the federal tax liens.
Because the decision to grant summary judgment calls a legal standard into play we review the district court’s order granting summary judgment for the United States
de novo. In re Varrasso,
As our discussion of jurisdiction relates, it is well-settled that federal law determines the priority of competing federal and state created liens.
See United States v. Rodgers,
These provisions do not, however, grant federal tax hens automatic priority over ah other hens.
I.R.S. v. McDermott,
Just as federal law governs the issue of priority, it is equally well-settled that , “in the application of a federal revenue act, state law controls in determining the nature of the legal interest ... in the property ... to be reached by the statute.”
Aquilino v. United States,
The government argues that because section 6323(i)(2) explicitly authorizes the application of local laws of subrogation and is silent as to the application of the doctrine of unjust enrichment, the district court was correct in deeming the latter doctrine inapplicable to Progressive’s claim. We disagree. While the court was correct in stating that Congress gave an “explicit directive with respect to determining the priority of federal tax liens,” it was incorrect in holding that “there is no basis upon which to presume the applicability of a common law doctrine” not expressly provided for by the statute. To essentially translate a directive for a federal scheme of priority into a preemption of state law governing the nature and extent of state created liens was unwarranted. To the contrary, federal courts should presume applicability of state common law doctrines in determining the status of state created liens. Such determinations do not contravene federal law simply because they ultimately bear *1236 on the federal issue of who was first in time in determining priority.
Before addressing the status of Progressive’s current mortgage, we briefly review its history. In 1987, MSFCU financed the Fol-kards’ first mortgage in the amount' of $150,-000.00. Between 1988 and 1990, the IRS filed six tax liens on the property, totalling $94,560.93. In 1990, MSFCU refinanced the Folkards’ first mortgage debt, then $130,-905.55, by executing a new note to secure a debt of $142,000.00. The recording of the 1990 mortgage discharged the 1987 mortgage, rendering the tax liens senior to MSFCU’s second mortgage on the record title to the property. In 1992, MSFCU assigned its mortgage to Progressive. Progressive argues that under the doctrine of unjust enrichment, MSFCU should be reinstated to its initial 1987 mortgage position and that Progressive is entitled to effectively occupy MSFCU’s reinstated position. We agree.
A. Massachusetts Common Law Doctrine of Unjust Enrichment
Under Massachusetts law, the doctrine of unjust enrichment provides that “where a mortgage has been discharged by mistake, equity will set the discharge aside and reinstate the mortgage to the position which the parties intended it to occupy, if the rights of the intervening lienholders have not been affected.”
North Easton Co-op Bank v. MacLean,
The government maintains that no “mistake” was made because MSFCU intended to refinance the Folkards’ first mortgage, and so by law must have intended the consequences of its actions — i.e. the extinguishment of its original security interests. Massachusetts law, however, clearly contemplates situations where the intention to renew is not tantamount to the intention to extinguish existing security interests upon refinancing a mortgage.
See North Easton Co-op Bank,
The district court held that reliance on the Massachusetts line of unjust enrichment cases was misplaced because such cases do not concern federal tax liens. Although it is true that Massachusetts case law does not address reinstatement of a state created lien to a position of priority over a federal government lien, we are not persuaded by the district court’s reasoning. We think that cases involving the reinstatement of mortgages which have been inadvertently discharged to the advantage of unintended and unexpected beneficiaries are sufficiently analogous to Progressive’s claim to warrant applicability. Whether or not federal tax liens are involved in such eases, to us, seems immaterial. This is mainly because the unjust enrichment doctrine operates only to restore a state created lien to the position it occupied prior to the inadvertent discharge. Reestablishing the party’s position, of itself, does not disturb the status of competing liens — whether those of a private lienor or the federal government — in terms of their effective dates of attachment for the determination of priority. It equitably determines the effective date of the state created lien independent of other existing liens. Federal law remains intact to determine both the choateness of the state created lien and its order of priority in relation to any competing federal liens.
Moreover, while Massachusetts courts have not had occasion to apply the doctrine of unjust enrichment to the federal government under this set of circumstances, federal courts have held that the doctrine is applicable where the federal government is concerned; and in several instances, have restored state created liens to their intended positions without regard for the United States’ potential loss of priority under federal law.
See United States v. McCombs,
Finally, we note that no rights of the government are impaired by MSFCU’s mortgage reinstatement. The government argues that the IRS is unlike a private creditor in that it does not bargain for interest rates and thus can never be unjustly enriched where valid liens have attached for unpaid taxes. But Progressive does not argue, nor do we suggest, that the government would be unjustly enriched by the ultimate satisfaction of its legitimate tax liens. The point is that the government could not have anticipated its current priority status because from the outset its 1988-1990 liens were clearly junior to MSFCU’s 1987 mortgage lien. Absent the inadvertent discharge of MSFCU’s mortgage in 1990, the government would not have gained serendipitous priority over MSFCU’s second mortgage lien in 1990. This resulted in the government’s unjust enrichment at the expense of MSFCU in 1990, and ultimately of Progressive in 1992. We hold that because MSFCU extinguished its initial 1987 mortgage interest by mistake upon refinancing the Folkards’ second mortgage in 1990, it should be equitably restored to its original 1987 lien position.
*1238
The government argues that the equities in favor of MSFCU may not apply to Progressive because there is no evidence that Progressive was unaware of the earlier government lien when it took the assignment of the mortgage from MSFCU. But it is horn-book law that the assignee of a mortgage succeeds to all of the assignor’s rights power and equities; and Massachusetts has applied this rule in a situation very like this case.
Provident Co-operative Bank,
B. Conclusion
The parties do not dispute that MSFCU’s mortgage lien was choate as of its original recording in 1987. It identified the lienor as MSFCU, described the Folkards’ property, and established the amount of the lien so that nothing more needed to be done for the lien to be “perfected.”
New Britain,
We reverse the district court’s decision and vacate its entry of summary judgment in favor of the United States. Summary judgment shall be entered in favor of Progressive and an appropriate declaratory judgment order shall be entered. Costs awarded to Progressive.
Notes
. The district court had
prima facie
jurisdiction to hear Progressive's claim because it involves issues of federal tax liens and taxation.
See
28 U.S.C. §§ 1331, 1340;
see also United States v. Brosnan,
. In relevant part, 28 U.S.C. § 2410 provides:
*1231 § 2410. Actions affecting property on which United States has lien
(a) Under the conditions prescribed in this section and section 1444 of this title for the protection of the United States, the United States may be named a party in any civil action or suit in any district court, or in any State court having jurisdiction of the subject matter—
(1) to quiet title to,
real or personal property on which the United States has or claims a mortgage or other lien.
. As mortgagee, Progressive holds legal title to the property,
see J & W Wall Sys., Inc. v. Shawmut First Bank & Trust Co.,
. Congress did intend section 2410(a)(1) to be a basis for taxpayer challenges to the procedural validity of tax liens.
See Robinson v. United States,
. The Code provides that "[t]he lien imposed by section 6321 shall not be valid as against any purchaser, holder of a security interest, mechan *1235 ic’s lienor, or judgment lien creditor until notice thereof....” 26 U.S.C. § 6323(a).
. "Where, under local law, one person is subro-gated to the rights of another with respect to a lien or interest, such person shall be subrogated to such rights for purposes of any lien imposed by section 6321 or 6324." 26 U.S.C. § 6323(i)(2).
