
117 Ill. App.3d 720 (1983)
453 N.E.2d 880
ROBERT W. HUDSON et al., Plaintiffs-Appellees,
v.
CATERPILLAR TRACTOR COMPANY, Defendant-Appellant  (Mid-America Contractors & Builders, Inc., Defendant).
No. 4-83-0157.
Illinois Appellate Court  Fourth District.
Opinion filed August 25, 1983.
*721 Hull, Campbell, Robinson & Gendry, of Decatur (Thomas W. Gendry, of counsel), for appellant.
Welsh, Kehart, Shafter & Hughes, P.C., of Decatur, for appellees.
Judgment affirmed.
JUSTICE GREEN delivered the opinion of the court:
 1 This case concerns a suit for enforcement of a subcontractor's mechanic's lien against an owner of real estate which has been improved pursuant to a contract with a general contractor. The owner contends that it is entitled to a reduction in the amount of the lien, because of payments it voluntarily made to the United States after receiving notice that the United States had a tax lien against all monies owed to the general contractor. The trial court held that the owner was not entitled to a reduction. We agree.
On December 12, 1979, plaintiffs, Robert W. Hudson, Richard Betterton, and Charles Hankins, brought suit in the circuit court of Macon County against defendants, Caterpillar Tractor Company (Caterpillar) and Mid-America Contractors & Builders, Inc. (Mid-America). The suit arose out of a contract whereby Mid-America agreed to construct a building on land owned by Caterpillar. Plaintiffs sought to foreclose a subcontractor's lien resulting from Mid-America's failing to pay them for work they performed pursuant to the subcontract. After a bench trial, the circuit court entered a judgment of foreclosure on September 28, 1982, (1) finding plaintiff was entitled to recover from "Defendant" the sum of $20,513.41 which included interest in the amount of $5,068.97, (2) finding plaintiff had a lien in that amount upon the premises of Caterpillar, and (3) ordering a sale of the premises to satisfy the amount owed. Caterpillar appeals. We affirm.
The case was tried on stipulated facts. The contract between Caterpillar and Mid-America was executed on December 14, 1977. On September 13, 1978, and October 17, 1978, pursuant to 26 U.S.C. sec. 6323 (1976), the United States properly recorded tax liens against Mid-America in the respective sums of $7,249.87 and $15,444.43 arising under 26 U.S.C. sec. 6321 (1976). On October 26, 1978, the subcontract between plaintiffs and Mid-America was executed providing *722 for a total price of $15,444.43. On December 26, 1978, the Internal Revenue Service served upon Caterpillar a notice of levy against any sums owed by Caterpillar to Mid-America. Plaintiffs complied with all statutory provisions necessary to perfect its claimed lien.
The original contract price between Caterpillar and Mid-America was $65,190. On June 16, 1978, without complying with its statutory duty to obtain affidavits of amounts owing to subcontractors (Ill. Rev. Stat. 1977, ch. 82, par. 5), Caterpillar paid directly to Mid-America the sum of $53,076 for work already performed. Thus, only $12,114 of the contract price remained unpaid. After receiving the notice of levy from the Internal Revenue Service, Caterpillar negotiated with that agency and obtained an agreement whereby the tax lien was released upon the payment by Caterpillar of the sum of $9,864. The theory of the agreement was that additional work at a cost of $2,250 had been arranged by Caterpillar to complete the work provided for in the original construction contract thus reducing the amount owed on it.
 2 Caterpillar maintains that the case turns upon a determination as to priority of right to "moneys * * * due [to Mid-America] under the original contract" (Ill. Rev. Stat. 1977, ch. 82, par. 21) between (1) the lien of the United States, and (2) the lien given by the aforesaid statutory provisions to plaintiffs as unpaid subcontractors. Caterpillar contends that, because a Federal tax lien has priority over a mechanics' lien created by State law (United States v. Security Trust & Savings Bank (1950), 340 U.S. 47, 49, 95 L.Ed. 53, 56, 71 S.Ct. 111, 112-13; 26 U.S.C. sec. 6323(h)(2) (1976)), it should receive credit against plaintiffs' lien for the $9,864 it paid to the United States in obtaining a discharge of the Federal lien. Caterpillar's analysis is incorrect for two reasons.
Section 21 of the Mechanics' Liens Act (Ill. Rev. Stat. 1977, ch. 82, par. 21) provides for unpaid subcontractors to have not only a lien against amounts owed by the owner to the general contractor, but also against the owner's real estate improved. The judgment of foreclosure here referred only to the latter type of lien. Caterpillar was the owner, and the United States had no lien against Caterpillar's real estate. No question of priority was involved as far as the lien foreclosed was concerned.
 3 Protection is given to owners as to the maximum amount they may be required to pay to contractors and subcontractors, for work performed and materials furnished pursuant to a contract between the owner and the general contractor, by the following statutory provision:
"In no case, except as hereinafter provided, shall the owner *723 be compelled to pay a greater sum for or on account of the completion of such house, building or other improvement than the price or sum stipulated in said original contract or agreement, unless payment be made to the contractor or to his order, in violation of the rights and interests of the persons intended to be benefited by this act. * * *" (Emphasis added.) Ill. Rev. Stat. 1977, ch. 82, par. 21.
As Caterpillar's previous payments to Mid-America had been made in violation of the rights and interests of plaintiffs by Caterpillar's failure to obtain the required affidavits (Ill. Rev. Stat. 1977, ch. 82, par. 5) in making its previous payment to Mid-America, the fact that payment to discharge plaintiffs' lien would require Caterpillar to pay to Mid-America and subcontractors more than the total contract price was not a defense which Caterpillar could have raised.
 4-6 Moreover, we conclude that under the circumstances here, there were no monies owing to Mid-America pursuant to its contract with Caterpillar. Accordingly, there was no obligation of Caterpillar to Mid-America to which the Federal lien upon Mid-America's property might attach. Whether Mid-America had a property right against Caterpillar was a question of State law. (Aquilino v. United States (1960), 363 U.S. 509, 4 L.Ed.2d 1365, 80 S.Ct. 1277.) Under Illinois law, an owner has a duty to subcontractors to withhold a sufficient sum to pay amounts due to them before making payments to the general contractor. (Ill. Rev. Stat. 1977, ch. 82, par. 27; Kiefer v. Reis (1928), 331 Ill. 38, 47, 162 N.E. 157, 160.) Here, the amount owed by Caterpillar to plaintiffs was greater than the balance otherwise owed on the contract with Mid-America.
The circuit court correctly awarded plaintiffs a lien against Caterpillar's real estate for the full amount due from Mid-America under the subcontract plus interest. We affirm.
Affirmed.
TRAPP and MILLER, JJ., concur.
