
27 Ariz. App. 168 (1976)
552 P.2d 455
Thomas E. BALLARD, Appellant,
v.
LAWYERS TITLE OF ARIZONA and Lawyers Title Insurance Corporation, Appellees.
No. 1 CA-CIV 2878.
Court of Appeals of Arizona, Division 1, Department C.
July 13, 1976.
John G. Gliege and Law Offices of Osmond A. Burton, Jr. by Osmond A. Burton, Jr., Scottsdale, for appellant.
Evans, Kitchel & Jenckes, P.C. by William L. Kurtz, Gary H. Fry, Phoenix, for appellees.
OPINION
WREN, Judge.
Thomas E. Ballard appeals from a judgment enjoining him from enforcing a judgment and writ of execution obtained in his suit to foreclose a mechanic's lien. The trial court concluded that the judgment obtained by Ballard was void and unenforceable *169 because he failed to join as party defendants the record owners of the property at the time the foreclosure suit was commenced. These record owners were found to be necessary parties to the foreclosure proceedings. The court further found that since the record owners were not joined, the judgment could not affect subsequent purchasers of their interests. Ballard's appeal is concerned only with the two properties where such a subsequent purchase was made while the suit to foreclose the mechanic's lien was pending.
The facts as stipulated to by the parties were that sometime prior to February 23, 1972, Lawyers Title of Arizona, the appellee, became trustee under a subdivision trust agreement and thereby held legal title to various lots in the Villa San Marcos subdivision including the two lots at issue on appeal, Lots 5 and 42. Emerald Properties, Inc., the developer of the subdivision, was the second beneficiary under the trust.
On February 23, 1972, Ballard, an employee of Emerald Properties, recorded a Notice and Claim of Lien against numerous lots in the subdivision on which he had performed services for Emerald Properties. Copies of the Notice and Claim of Lien were sent to Lawyers Title and Emerald Properties on March 2, 1972. Lots 5 and 42 were conveyed out of trust to Emerald Properties and simultaneously from Emerald Properties to the home buyers on February 21 and February 29, 1972 respectively. The deeds were recorded on March 7, and March 1, 1972, respectively.
On June 25, 1972, Ballard sued to foreclose the Notice and Claim of Lien, naming Emerald Properties as the only defendant in the action. After suit was filed, the owners of Lots 5 and 42 sold their homes through an escrow established at U.S. Life Title Company. Lawyers Title subsequently agreed to U.S. Life Title's request to indemnify them against any future loss arising out of Ballard's Notice and Claim of Lien pending foreclosure suit.
On March 1, 1973, summary judgment for Ballard against Emerald Properties was entered; Emerald Properties had not appeared. On October 11, 1973, a Writ of Special Execution was issued to the Sheriff of Maricopa County against the lots. Lawyers Title then files suit against Ballard and the Sheriff of Maricopa County to permanently enjoin the enforcement of the foreclosure judgment and the writ of execution on the grounds that the judgment was void for failure to join necessary parties. This injunction was granted and Ballard appealed from that judgment only as it pertains to the enjoining of the foreclosure against Lots 5 and 42.
Ballard's first contention on appeal is that the trial court lacked subject matter jurisdiction because Lawyers Title was not the real party in interest. Rule 17(a) of the Arizona Rules of Civil Procedure requires that "[e]very action shall be prosecuted in the name of the real party in interest." Arizona Rule of Civil Procedure 9(a) provides, inter alia:
"... When a party desires to raise an issue as to the legal existence of any party or the capacity of any party to sue or be sued or the authority of a party to sue or be sued in a representative capacity, he shall do so by specific negative averment, which shall include such supporting particulars as are peculiarly within the pleader's knowledge."
Rule 9(a) has been interpreted to require the issue of capacity to be raised by motion before the answer is filed or by way of an affirmative defense. If not raised, any objection to capacity is waived. Reeves v. Arizona Aggregate Ass'n. Health & Welf. Fund, 102 Ariz. 595, 435 P.2d 829 (1967); Trico Electric Cooperative v. Ralston, 67 Ariz. 358, 196 P.2d 470 (1948). The defense to capacity to sue that plaintiff is not the real party in interest is not jurisdictional and can be waived if not asserted by the defendant. Fox v. McGrath, 152 F.2d 616 (2d Circuit 1945); Gifford-Hill-Western, Inc. v. Anderson, 496 P.2d 501 (Wyoming 1972); Wilson v. Interior Airways, Inc., 384 P.2d 956 (Alaska 1963). Ballard has raised this issue for the first *170 time on appeal and therefore he must be found to have waived this objection.
Ballard also asserts that principles of equitable estoppel must prevent Lawyers Title from maintaining an action to enjoin foreclosure of his Notice and Claim of Lien. However, this theory was not argued to the trial court and will not be considered for the first time on appeal. Milam v. Milam, 101 Ariz. 323, 419 P.2d 502 (1966); Davis v. Kleindienst, 64 Ariz. 251, 169 P.2d 78 (1946); Leahy v. Ryan, 20 Ariz. App. 110, 510 P.2d 421 (1973).
Ballard's final argument on appeal is that the trial court erred in enjoining enforcement of the foreclosure judgment against Lots 5 and 42 because the purchase of those lots occurred during the pendency of the lawsuit and the purchasers had notice of the foreclosure action and therefore took the property subject to the outcome of the foreclosure action.
In order to validly foreclose a mechanic's lien on real property, the owners of the property at the time the complaint is filed must be joined as party defendants. These owners are necessary parties without whose joinder no valid, enforceable judgment can be rendered. Flintkote Company v. Lisa Construction Company, 268 Cal. App.2d 606, 74 Cal. Rptr. 136 (1968); Packard Bell Electronics Corp. v. Theseus, Inc., 244 Cal. App.2d 355, 53 Cal. Rptr. 300 (1966); Bain v. Mazel, 275 Ala. 531, 156 So.2d 624 (1963); Demma v. Forbes Lumber Company, 133 Ind. App. 204, 178 N.E.2d 455, 181 N.E.2d 253 (Indiana 1962); Peters v. Dona, 49 Wyo. 306, 54 P.2d 817 (1936); Burbank v. Wright, 44 Minn. 544, 47 N.W. 162 (1890). If the sole defendant in a suit to enforce a lien has no interest in the property, as was the case with Emerald Properties at the time the lawsuit was filed, there is nothing upon which to base the lien and the judgment is void. Hervey v. Commercial Bank, 152 Miss. 894, 120 So. 463 (1929).
Although a purchaser of real property during the pendency of a foreclosure suit is not a necessary party to the action, he is bound by the judgment if he had notice of the foreclosure. This result, however, presupposes that the owner at the time suit was commenced was a party defendant. Packard Bell Electronics Corp. v. Theseus Inc., supra. As previously noted, a foreclosure suit, in which the record owner at the time the complaint was filed is not a party defendant, is void. Even if the owner knew of the suit, any judgment is void because having not been a party, the owner cannot be bound. Burbank v. Wright, supra. Therefore, a sale of the property to one who also may have knowledge of the pending foreclosure suit cannot validate a void judgment entered without joinder of a necessary party.
The judgment granting a permanent injunction is affirmed.
EUBANK, P.J., and NELSON, J., concur.
