
399 Mass. 541 (1987)
505 N.E.2d 883
HAMMILL-McCORMICK ASSOCIATES, INC.
vs.
NEW ENGLAND TELEPHONE AND TELEGRAPH COMPANY.
Supreme Judicial Court of Massachusetts, Hampden.
January 9, 1987.
April 6, 1987.
Present: HENNESSEY, C.J., WILKINS, LIACOS, NOLAN, & O'CONNOR, JJ.
Claude C. Dickson for the defendant.
Mary Downey Costello for the plaintiff.
HENNESSEY, C.J.
In this case a judge of the Superior Court ordered partial summary judgment to be entered in favor of a subcontractor against the owner of a building for which the subcontractor had supplied labor and materials. The judge then reported the following question: "Whether a subcontractor who furnishes labor or material or both under a written contract with a contractor wherein a completion date for that contract is set out, establishes a subcontractor's lien in compliance with M.G.L.c. 254, § 4 by filing a notice of contract in the appropriate registry of deeds after the required work is performed but prior to the completion date stated in the contract. The Court has determined that in all other respects, the plaintiff has complied *542 with the mechanics lien statute." We answer the reported question in the affirmative.
The defendant, New England Telephone and Telegraph Company, Inc. (owner), entered into a general contract with A.L. Phelps, Inc. (general contractor), on September 8, 1982, for the repair and maintenance of the owner's Dial Exchange Building in East Longmeadow. On October 29, 1982, the general contractor entered into a subcontract with the plaintiff, Hammill-McCormick Associates, Inc. (subcontractor), for the performance of work and the supply of materials in connection with the general contract. The subcontract provided that all work must be completed by April 23, 1983. The subcontractor filed a notice of contract in the Hampden County registry of deeds on April 22, 1983, and actual notice dated April 22, 1983, was received by the owner on April 27, 1983.[1] The notice of contract was filed after the subcontractor's work had been performed, but before the date set for the completion of the contract. On May 2, 1983, the owner made a payment to the general contractor in the amount of $60,991.
On July 15, 1983, the subcontractor commenced this suit naming both the general contractor and the owner as defendants. The subcontractor moved for summary judgment against the owner on the lien. The judge entered partial summary judgment for the subcontractor, finding that the lien had been established in compliance with G.L.c. 254, § 4 (1984 ed.), in the amount of $26,345, plus interest. The owner appealed from the entry of partial judgment, and the judge reported the question set forth above. This court took the case on its own motion.
General Laws c. 254 provides that a debt due to a person who performs labor or supplies material for the improvement of real estate by agreement or with the express or implied consent of the owner is secured by a mechanic's lien. The primary purpose of the lien is to provide security to contractors, subcontractors, laborers, and suppliers for the value of their *543 services and goods provided for improving the owner's real estate. See Mitchell v. Packard, 168 Mass. 467, 469 (1897). At the same time, the statute contains filing and notice requirements to protect the owner and others with an interest in the property. See Pratt & Forrest Co. v. Strand Realty Co., 233 Mass. 314, 317-318 (1919); Rheem Mfg. Co. v. Monsanto Co., 6 Mass. App. Ct. 461, 465 (1978). A subcontractor with a written contract may perfect the lien by filing a notice of the contract as specified by G.L.c. 254, § 4.[2] The lien is a *544 creature of the statute, and can be enforced only by strict compliance with the statute. See Valentine Lumber & Supply Co. v. Thibeault, 336 Mass. 411, 413 (1957); Street Lumber Co. v. Sullivan, 201 Mass. 484, 485 (1909).
The issue in this case is when must a subcontractor file notice of the contract, and give actual notice, to secure his claim. The subcontractor contends that the time limit is the completion date stated in its contract with the general contractor. The owner contends that filing and notice must occur before the subcontractor actually completes performance.
The statute does not explicitly state a deadline for filing. Language in the statute describing the completion date specified in the notice is prospective: "Said contract is to be completed on or before ..." (emphasis added). G.L.c. 254, §§ 2, 4. "For the purposes of this chapter the date of completion stated in the notice of contract filed ... shall be the date on which the contract is to be performed" (emphasis added). G.L.c. 254, § 4.
The defendant relies on the Rheem case, but we think that case does not support the defendant's position. In that case, the general contractor in July, 1974, entered into a contract with the owner to construct a building on the owner's land. The general contractor engaged a subcontractor to do heating and air conditioning work, and the subcontractor in turn ordered seven air conditioner units from the Rheem Company, apparently without a written contract specifying a completion date. Rheem delivered the units to the job site shortly before January 1, 1975. Rheem submitted a bill to the subcontractor about that time, which the subcontractor never paid. On November 14, 1975, Rheem filed a notice of contract, which recited that Rheem had completed its performance of the contract on October 6, 1975. On November 26, 1975, Rheem filed a statement *545 of account setting forth the payments it was due. In early January, 1976, at the request of the general contractor, Rheem reversed some panels on one of the units to prevent snow from blowing into the building. On January 6, 1976, Rheem filed a second notice of contract which stated that it had completed the contract on December 14, 1975, and filed a second statement of account.
The Appeals Court concluded that Rheem had not timely filed its notice of contract, and that, therefore, it had not secured the payment it was due with a lien on the property of the owner. Language in the Appeals Court's opinion suggests that the subcontractor must file a notice of contract prior to actually completing performance, and the owner in this case argues that Rheem should control. We disagree. Rheem involved substantially different facts from this case. Rheem had no contractually specified completion date. Although Rheem completed actual performance by January 1, 1975, it did not file a notice of contract until November 14, 1975. Moreover, Rheem recited in that notice that the completion date was October 6, 1975. Even accepting Rheem's recital of the completion date, Rheem filed notice of contract after both dates in question.
In this case, the subcontractor had a written contract with a specified completion date, and filed notice before that date. We conclude that a subcontractor who files before the completion date stated in its contract has timely filed its notice of contract under G.L.c. 254, § 4. The statute indicates that the date of completion to be specified in the notice of contract is that date specified in the written contract itself. The statute as originally drafted provided that the lien secured only work performed subsequent to filing, and we think the Legislature intended that the subcontractor must specify the contract date. See Pratt & Forrest Co. v. Strand Realty Co., supra at 317; Extract from the Report of the Special Commission Appointed to Consider and Recommend Changes in the Law Relative to Liens, Mortgages, and Tax Titles, 1 Mass. L.Q. 344, 351 (1916) (excerpt from 1915 House Doc. No. 1600). Moreover, § 4 specifies a procedure to follow where "the contract does not contain a completion date." The clear implication is that, *546 in all other cases, the contract date is to be specified. In addition, the statute provides a specific procedure for recording the extensions of the completion date set out in the written contract. Finally, the 1972 and 1973 amendments, extending the lien to secure payment for performance prior to filing the notice, were intended to protect subcontractors who may have neglected to file as early as possible, as a prudent subcontractor would. See St. 1973, c. 801, § 2; St. 1972, c. 774, § 8. We do not think the Legislature intended to deny all security to a subcontractor who completes performance early and files before the completion date, while granting full security to a subcontractor who files on the same date, but does not complete performance until the last minute. Such a distinction would protect no legitimate interest of the owner, while severely penalizing the subcontractor who completes performance early.
Accordingly, we answer the reported question in the affirmative.
NOTES
[1]  The owner does not argue that actual notice was not "given" before April 23, 1983.
[2]  General Laws c. 254, § 4 (1984 ed.), provides: "Whoever, subsequent to the date of the original contract, furnishes labor or material, or both labor and material, or performs labor, under a written contract with a contractor, or with a sub-contractor of such contractor, may file in the registry of deeds for the county or district where such land lies a notice of his contract substantially in the following form:

"Notice is hereby given that by virtue of a written contract dated between, contractor (or sub-contractor), and said is to furnish or has furnished labor or material, or both labor and material, or perform labor in the erection, alteration, repair or removal of a building or structure by, contractor, for, owner, on a lot of land described as follows:
"Said contract is to be completed on or before
"A notice of any extension of such contract, stating the date to which it is extended, shall also be filed or recorded in said registry prior to the date stated in the notice of the contract for the completion thereof.
"Upon filing a notice, as hereinbefore provided, and giving actual notice to the owner of such filing, the sub-contractor shall have a lien to secure the payment of all labor and material, which he is to furnish or has furnished, upon the building or structure, and upon the interest of the owner, as appears of record at the time of such filing, in the lot of land on which said building or structure is situated. But such lien shall in no event exceed the amount due or to become due under the original contract when notice of the filing of the sub-contract is given by the sub-contractor to the owner, and the time for the performance of the contract of the sub-contractor shall not be extended beyond the time for the performance of the original contract and any extension thereof, if the objection thereto of the owner is filed in the registry of deeds and actual notice of such objection is given by the owner to the sub-contractor within five days after the owner received notice of the filing of the contract as provided in this section.
"Such notice may also be filed by the trustee or trustees of a fund or funds, described in section one, providing coverage or benefits to any person performing labor under a written contract with a contractor, or with a subcontractor of such contractor.
"If the contract does not contain a completion date, the person filing the notice of contract in the registry of deeds shall set forth a date of completion which shall be subject to objection by the owner as set forth above if the date of completion is later than the time for the performance of the original contract and any extension thereof. For the purposes of this chapter the date of completion stated in the notice of contract filed in the registry of deeds or in any properly filed notice of extension of such contract shall be the date on which the contract is to be performed."
