
24 Ariz. App. 400 (1975)
539 P.2d 514
REALTY EXECUTIVES, INC., Appellant,
v.
NORTHRUP, KING & CO., Appellee.
No. 1 CA-CIV 2728.
Court of Appeals of Arizona, Division 1, Department A.
September 4, 1975.
Rehearing Denied October 10, 1975.
Review Denied November 4, 1975.
Goldstein, Mason & Ramras, Ltd. by David N. Ramras, Phoenix, for appellant.
Jennings, Strouss & Salmon by Riney B. Salmon, II, Phoenix, for appellee.
OPINION
FROEB, Judge.
This action was commenced by appellant, Realty Executives, Inc. (Realty), a real estate brokerage firm, to collect a broker's commission from appellee, Northrup, King & Co. (Northrup), after Northrup sold a parcel of land to Holsum Bakery. Realty alleged that Northrup wrongfully refused to pay the commission in violation of an exclusive listing agreement. Northrup asserted, as an affirmative defense, that the agreement as well as efforts to sell the land were illegal because the salesman involved was not licensed. Both parties filed motions for summary judgment, supported by affidavits, depositions, documentary evidence and certified copies of the records from the office of the Arizona State Department of Real Estate. Northrup's motion for summary judgment was granted by the trial court, from which Realty has appealed. From our review of the pleadings, exhibits, depositions and memoranda in the record, we find the undisputed facts to be as follows:
On January 25, 1972, Realty Executives hired Daniel T. Smith, a real estate salesman previously licensed by the Arizona State Department of Real Estate and *401 formerly employed with the brokerage firm of Ben Brooks and Associates. On that date Smith mailed to the Real Estate Department his notice of "Change of Broker by Salesman." The day before Ben Brooks mailed to the Department a "Broker's Notice of Salesperson Severing Connection," together with Smith's real estate licnse. These were received by the Real Estate Department along with a transfer fee, all of which were necessary for the Department to transfer and reissue Smith's license to reflect his new affiliation with Realty Executives, Inc. The records of the Real Estate Department show that the reissuance of the license to Smith in his new association became effective as of February 2, 1972.
On January 25, 1972, the day he was hired by Realty Executives, Smith procured on their behalf, though he was then unlicensed, an exclusive listing agreement from Northrup for the sale of a parcel of land Northrup had been trying to sell since the Fall of 1970. The agreement provided, among other things, that if no sale was consummated within thirty days, Realty would still be entitled to its commission if, within ninety days from the expiration of the agreement, Northrup made a sale to any person to whom the property had been shown by Realty Executives.
On January 26, 1972, the day after the listing agreement was executed, Smith called a representative of Holsum Bakery, Clyde Mills, and arranged to meet him that afternoon at Mills' office for the purpose of presenting the Northrup property for sale. Holsum was an adjacent landowner whom Smith considered a prospective buyer of the Northrup property. During the course of this meeting, Smith offered to sell the parcel to Holsum on terms that were consistent with the listing agreement. Mills rejected the offer because the price was too high. He did indicate, however, in response to a suggestion by Smith, that Holsum would be interested in such a purchase if Smith could find a tenant for the property.
After this meeting, Smith did not confer again with Mills until February 22, 1972, two days before the listing agreement expired.
In the meantime, Smith's license had been reissued and transferred to him on February 2, 1972. From February 7 through 11, he solicited other adjacent landowners whom he felt might be potential buyers or tenants of the property. This effort proved to be fruitless and, on February 14, he sent to Holsum an appraisal of the property, accompanied by some photographs and various descriptions. No response was forthcoming from Holsum. On February 16, 1972, Roger Conant, an adjacent landowner to whom the property had been previously offered by Smith, indicated he was prepared to make a counteroffer to Northrup for sale of the land. Smith prepared Conant's counteroffer and submitted it to Northrup who then took it under consideration.
Thereafter, on February 22, 1972, Clyde Mills and Smith once again discussed the sale of the property to Holsum. While there is some dispute in the record as to who initiated the contact between the two, Smith told Mills that he had not procured a tenant; that a counteroffer had been submitted to Northrup by Conant; and that a sale of the property might be imminent and if Holsum were still interested in the realty it had better act soon.
The exclusive listing expired on February 25, 1972, and a sale had not yet been made. Thereafter, on March 3, 1972, Holsum submitted an offer directly to Northrup which was accepted on March 23, 1972.
After an unsuccessful demand was made by Realty Executives on Northrup for the commission from the sale, this suit followed. Realty based its claim on the provision of the listing agreement by which it was entitled to a commission if, within ninety days of the expiration of the agreement, Northrup sold the property to someone to whom Realty had shown it. It alleged that the sale of March 23 was within the ninety-day period, which began running *402 when the exclusive listing agreement expired on February 25. It also alleged that it had shown the property to Holsum Bakery and was therefore entitled to recover its commission.
At the outset we must determine the status of Smith's license as a salesman from the time he left the employ of Ben Brooks and Associates on January 24, 1972, until a new license as a salesman for Realty Executives, Inc. was issued by the Real Estate Department on February 2, 1972.
Arizona Revised Statutes, § 32-2128 in effect at this time provided:
"Any license issued under the provisions of this chapter shall authorize the licensee to do business only at the location set forth therein. All licenses, whether of broker or salesman, shall be prominently displayed in the office of the real estate broker. A salesman's license shall remain in possession of the employer until cancelled or until the licensee leaves his employ, when it shall be returned to the commissioner by the broker for cancellation."
Thus under this provision, Smith's license was valid only while he was employed by Ben Brooks and Associates. Until the Real Estate Department issued him a license in the employ of Realty Executives, Inc., he could not lawfully act for it as a salesman as he was unlicensed. Farragut Baggage and Transfer Company v. Shadron Realty, Inc., 18 Ariz. App. 197, 501 P.2d 38 (1972).
The question before us, then, is whether as a matter of law Smith's acts in obtaining the listing agreement and offering the property for sale during the period he was unlicensed will bar recovery of the commission by Realty Executives. We find that they do.
Realty first points out that it was properly licensed at all times and therefore it fully complied with A.R.S. § 32-2152, which states:
"An action for the collection of compensation earned may be maintained in the courts of the state by any broker or salesman. To commence the action the complaint shall allege that the plaintiff was a qualified licensed broker or salesman at the time the claim arose...."
[Emphasis added.]
Merely alleging and proving that Realty was in compliance with this provision is not sufficient, standing alone, to overcome the contention that the transaction upon which the claim is based was at least in part the result of illegal services performed by Smith. Farragut Baggage and Transfer Company v. Shadron Realty, Inc., supra. See also Bendell v. DeDominicis, 251 N.Y. 305, 167 N.E. 452 (1929). Illegality is a defense to the action independent of the burden of allegation and proof contained in A.R.S. § 32-2152.
"... It is true that A.R.S. § 32-2152 requires the plaintiffs to plead and prove, as a condition precedent to recovery of the commission, that he was licensed at the time the claim arose. However, we are of the opinion that compliance with A.R.S. § 32-2152 is not the sole condition limiting a broker's rights to recover his commission. In the case of Iron Inv. Co. v. Richardson, 184 Wash. 118, 50 P.2d 42 (1935), the court held that the other statutes, including the Washington counterpart of our A.R.S. § 32-2122, imposed an added burden of compliance." [Citations omitted.] Farragut Baggage and Transfer Company v. Shadron Realty, Inc., 18 Ariz. App. 197, 200, 501 P.2d 38, 42 (1972).
The legislature has enacted comprehensive legislation to regulate the licensing and conduct of real estate salesmen and brokers. A.R.S. § 32-2101 et seq. The purpose of these statutes is to protect the public and render judicial relief unavailable for the recovery of a commission which would be in violation of the law. Bonasera v. Roffe, 8 Ariz. App. 1, 442 P.2d 165 (1968). Listing property for sale and carrying on sale negotiations are acts which require a salesman's or broker's license. A.R.S. §§ 32-2101, 32-2122. It is *403 illegal for a salesman to engage in the business of a real estate broker or salesman without a license (A.R.S. § 32-2122), as well as for a broker to employ and utilize the services of an unlicensed salesman (A.R.S. § 32-2155). A broker or salesman is not entitled to recover where his cause of action cannot be established without showing that he has violated the law. See Northen v. Elledge, 72 Ariz. 166, 232 P.2d 111 (1951); cf. Firpo v. Murphy, 72 Cal. App. 249, 236 P. 968 (1925).
Recovery of a real estate commission was denied by the Court of Appeals in Farragut Baggage and Transfer Co. v. Shadron Realty, Inc., supra, on facts somewhat similar to the case at bar. There the salesman negotiated a lease while he was unlicensed but was duly licensed at the time it was formalized and signed. Although it was contended that the formal execution of the lease was the point in time at which the claim for the commission arose, thus making it a claim on behalf of a licensed salesman as opposed to an unlicensed salesman, the court held to the contrary on the ground that the illegality of negotiations conducted by an unlicensed salesman tainted the entire claim.
In this case Smith arranged for and signed, on behalf of Realty, a listing agreement which was unlawful since he was not licensed. Insofar as the listing agreement provides the basis for the claimed commission, it is therefore unenforceable by Realty.
Moreover, Smith presented the property to Holsum for sale on January 26, 1972, also at a time when he was unlicensed as a salesman. Though the offer was refused at the time, the event was clearly interrelated to the ultimate sale of the property to Holsum and the statutory illegality set forth in A.R.S. § 32-2122 is therefore inseparably present.[1] As in Farragut, it matters not that the salesman became licensed at a later time prior to completion of the transaction between the seller and buyer.
For the foregoing reasons, the judgment of the trial court in favor of Appellee Northrup, King & Co. and against Appellant Realty Executives, Inc. is affirmed.
OGG, P.J., and DONOFRIO, J., concur.
NOTES
[1]  A.R.S. § 32-2122 in effect at the time of these transactions read as follows:

"§ 32-2122. License required of brokers and salesmen
"It shall be unlawful for any person to engage in the business of a real estate broker or salesman without first obtaining a license as prescribed in this chapter and otherwise complying with the provisions of this chapter."
