The earlier statutes providing for mechanic’s liens gave the lien only when there was a contract with the owner of the land. St. 1819, c. 156, § 1. Rev. Sts. c. 117, § 1. Thaxter v. Williams, 14 Pick. 49, 53. See Howard v. Robinson, 5 Cush. 119. The lien was extended by St. 1851, c. 343, to cases where the person who made the contract for labor or materials had •contracted with the owner of the land for its purchase, “for the purpose of erecting and [any] building thereon.” See Donahy v. Clapp, 12 Cush. 440; Metcalf v. Hunnewell, 1 Gray, 297. By St. 1852, c. 307, § 1, the lien was further extended to cases in which labor or labor and materials had been “ expended in the erection or repair of any building, by virtue of any contract with the owner thereof, or other person having authority to contract for such labor ”; with a proviso that no lien for materials should attach to any building or land, unless, before furnishing the materials, the person claiming the lien had given notice of his intention to claim it to the owner of the land and to the person ■who had contracted with the owner. It was held, in Belding v. Cushing, 1 Gray, 576, 579, 580, under the statute last cited, that it was the intention of the Legislature “ to provide the means for imposing, in behalf of laborers and mechanics, a lien upon real estate only, and not upon personal property.”
In the year after this decision the Legislature made a further provision, the language of which made “ any building or structure upon real estate ” the subject of the lien, as well as the interest of the owner of the building or structure in the lot of land on which it was situated, with a proviso that no lien for materials should attach, unless notice of intention to claim a *435lien was given to the owner of the land if such owner was not the purchaser of the materials. St. 1855, c. 431, § 1. The language of this statute includes all buildings and structures on real estate, whether the buildings are personal property or part of the realty. That it was so intended and understood by the Legislature is apparent from the note reviewing this legislation appended by the commissioners who reported the revision of the laws in the year 1858, which became the General Statutes of 1860, to chapter 150 of their report, in which note they state that, “As the lien may be upon a building or structure the owner of which has no estate or interest in the land upon which it is erected,” certain provisions have been altered “ so as to provide for a sale in such cases; but as the property in such building might be, and for some purposes is, regarded as personal estate, and as the owner of the land might perhaps require its removal, section 24 [the section giving a right of redemption in real estate sold] has not been extended to such cases.” One alteration so made to provide for a sale in cases where the owner of the building or structure has no estate or interest in the land upon which it is erected, was the substitution in § 2 of the words “ notice to the owner of the property to be affected by the lien ” for the words “ notice to the owner of the land,” found in St. 1855, c. 431, § 1. Another alteration for the same purpose was the substitution of the words “ shall order notice to be given to the owner of the building or structure,” in § 14 of the commissioner’s draft, for the words “ shall order notice to be given to the owner of the land ” used in Rev. Sts. c. 117, § 7. So the words, “ When the owner of the land shall have failed to perform his part of the contract,” found in Rev. Sts. c. 117, § 13, are changed by the commissioners to “ When the owner-fails to perform his part of' the contract,” in § 20 of the draft. And in § 27 of the draft, providing for the disposition of a surplus of proceeds of a sale made in enforcing a lien, the words “ shall be forthwith paid over to the owner of the property ” are substituted for the words “ shall be forthwith paid over to the owner of the land,” used in Rev. Sts. c. 117, § 20.
The provisions reported by the commissioners were enacted by the Legislature. See Gen. Sts. c. 150, §§ 1, 2, 14, 20, 27. The language of § 1 gives the lien upon “ any building or *436structure upon real estate,” if the debt is due “by virtue of an agreement with, or by consent of, the owner of such building or structure, or any person having authority from, or rightfully acting for, such owner ”; and the language of the present statute, Pub. Sts. c. 191, § 1, is the same, save that the words “ a building or structure ” are used in the latter as the equivalent of “ any building or structure.” See Pub. Sts. c. 191, §§ 1, 2, 16, 23, 30.
In our opinion this makes it clear that Gen. Sts. c. 150 and Pub. Sts. c. 191 were intended by the Legislature to give a lien upon buildings the owner of which had no estate or interest in the land upon which the building was erected, as well as upon any interest which the owner of a building might have in land on which it might be erected, and that the lien might extend to a building erected upon land although the building was personal property.
The contrary opinion expressed in Hayes v. Fessenden, 106 Mass. 228, 231, and in Stevens v. Lincoln, 114 Mass. 476, 478, was not necessary to the decision of either of those cases, and therefore is not binding as an authoritative construction of the statute. In neither of those cases was the building personal property. In the former it was put upon the land by one who had merely a written agreement with the owners of the land for its purchase; and the lien was denied, for the sufficient reason that a person holding such an agreement merely could not charge the building with a lien, because he was not the owner of the building, under the authority of Poor v. Oakman, 104 Mass. 309. The statements, “ If he had had an interest in the building as personal property, the lien would not have attached,” to which Belding v. Cushing, 1 Gray, 576, decided as we have seen before the adoption of the General Statutes, alone is cited, and “ The statutes do not contemplate any severance of the building, or a sale of it, or of any interest in it, separate from an interest of the owner in the land itself,” were wrong.
So in Stevens v. Lincoln, 114 Mass. 476, where a lien was denied because by mistake a schoolhouse had been built partly upon lands of the town and partly upon lands of other persons, and it was not shown how much of the work was done on the respondent’s land, there was no ground for contending that thp *437building was personal property. So much of it as stood on land of other persons than the respondent was the real estate of those persons, and so much of it as stood on the respondent’s land was the respondent’s real estate; and the ground upon which the exceptions were sustained was, that it could not be shown how much of the work was done upon the building on the respondent’s land. The statement, “ It is well settled that if a party for whom work is done has an interest in a building only as personal property, the owner of the land never having consented to or authorized such work thereon, no lien can attach thereto, and this because such party has no interest which can be sold so as to render the lien effectual; and further, that it is not contemplated by the statutes that there shall be any severance of the building, or a sale of it or of any interest in it separate from an interest of the owner in the land itself,” to which Belding v. Cushing and Hayes v. Fessenden are cited, was not necessary to the decision and was misleading.
In our opinion, under the true construction of Pub. Sts. c. 191, § 1, a lien is given upon any building or structure upon real estate, irrespective of the fact whether the building is real or personal property, to any person to whom a debt is due for labor performed or furnished, or for materials furnished and actually used in the erection, alteration, or repair of such a building by virtue of an agreement with, or by consent of, the owner of such building or structure, or of any person having authority from, or rightfully acting for, such owner in procuring or furnishing such labor or materials. If the owner of the building has an interest in the land on which the building is situated the lien attaches also to that interest. And under the provisions of Pub. Sts. c. 191, the lien can be enforced by a sale of the building alone, if its owner has no interest in the land on which it is situated, and by a sale of the building and of the interest of the owner of the building in the land, if he has an interest in the land.
In the present case the lease to the respondent required the erection of the building, and so was a consent to its erection on the part of the owner of the land, and as the lease also gave to the respondent an estate for years in the land, this made the respondent the owner of the building within the meaning of *438Pub. Sts. c. 191, § 1, for the term of years at least. We assume further, as the respondent contends, that the terms of the lease have the effect to prevent the building from becoming part of the realty, and that it is the respondent’s personal property. Notwithstanding this, the liens of the petitioners attached to the building, and to the respondent’s estate for years in the land on which the building is situated, and were properly ordered to be established. Exceptions overruled.