delivered the opinion of the court.
The action was in mandamus by Euphemia N. Buck, defendant in error, against the Cook Railway Signal Company and others, plaintiffs in error, to compel the transfer on the books of the company, and the issuance to her, of certain of its capital stock, which she claimed to have bought of her husband, and which he had assigned to her. An alternative writ issued which was made peremptory, and the company brings the case here for review. •
By answer the defendant put in issue practically every averment of the petition and writ, the averments relating to a demand for the issuance of the stock and refusal to comply therewith alone, being unchallenged. The matters so put in issue are that plaintiff for a valuable consideration bought the stock of her husband, its assignment to her, her ownership of the stock, that she complied with all or any of the requirements of the by-laws of the company with reference to transfer of stock, and that she has been damaged by reason of the refusal to comply with her demand for transfer.
It seems clear that if plaintiff was not the owner of the stock, or if the certificates had not been assigned to her, or if she had failed to comply with the by-laws relating to transfer, then the officers of the company ought not to have complied with her demand, and no judgment of the court could have been rightfully rendered compelling them to do *370so. Notwithstanding the issues thus tendered, the court sustained a general demurrer of plaintiff to the answer, which included a separate and special defense; and on motion for judgment on the pleadings, without proof, made the alternative writ peremptory, and entered judgment for a transfer of the stock, with an assessment of damages in the sum of $75.00. The matters put in issue were material, without proof of which plaintiff could not prevail, and a judgment on the pleadings was unwarranted. That the entry of such a judgment, under such circumstances, is unauthorized is established by the decisions of this court in Parr v. Sexson, 56 Colo. 491, 138 Pac. 768, and Board of Directors of Yellow Jacket Irr. Dist. v. Wessels, 58 Colo. 246, 144 Pac. 869.
In addition to the general denial the defendants, as a separate and independent defense, set up an agreement between the defendant company and Parker, its fiscal agent, for the sale by him of treasury stock of the company on commission, alleging that, to protect the treasury stock, maintain its selling price, prevent sales by individual owners, and thus enable the defendant company speedily to acquire a fund for establishing and maintaining its corporate business, the company and its individual stockholders, including the husband of plaintiff, specifically agreed between themselves and with Parker not to sell, traffic in or transfer any of their shares, which covered the stock in controversy, while the contract with the latter for the sale of treasury stock was in force; that plaintiff had full knowledge of the existence of this agreement at the time of the alleged assignment of the stock to her, and therefore took it subject thereto; that she paid no consideration for the,stock, and that the alleged and pretended assignment and sale to her was colorable merely, and not in good faith. The court sustained a general demurrer to the answer, holding in effect that the matters and things alleged and set up in the further answer constituted no defense. This was plainly *371error. The allegations of this defense, when uncontradicted, considered in connection with the legitimate deductions to be drawn therefrom, warrants the conclusion, if plaintiff had in fact secured the stock, that it was held not for herself or in her own right, but for and in the interést of her husband, to enable him to avoid this agreement. In short, that her holding was nominal only.
The parties to the agreement were the corporation itself, including'its officers, all of its individual stockholders, and the selling agent of the treasury stock, the only persons who could have any interest in the affairs of the company; it rested upon a good consideration, and we see no legal objection to it. The voting power was not withdrawn from the stock, and its exclusion from the market was but temporary. It was an agreement well calculated to advance and promote the interests of the company generally, in which result individual shareholders would be the chief beneficiaries, and for this reason alone, if for no other, should be approved and upheld. It follows, therefore, from the record as it now stands, that plaintiff’s rights in the stock, if any, are subject to a valid and enforceable agreement which suspended for a time the right of alienation and transfer usually enjoyed by a stockholder. She practically stands in the place of her assignor, a party to the agreement. Notwithstanding this she demands a transfer of the stock on the books of the company, freeing it from the restrictions of the agreement. It seems clear that in such circumstances she was not entitled to the relief prayed and given. While no case has been found precisely in point, in principle our conclusion appears to be supported by the following authorities. Williams v. Montgomery, 148 N. Y. 519, 43 N. E. 57 ; Senn v. Mercantile Co., 115 Mo. App. 685, 92 S. W. 507 ; Trust and Savings Company v. Home Lumber Company, 118 Mo. 447, 24 S. W. 129 ; 4 Thompson on Corporations, 2nd Ed., § 4136 ; 3 Clark and Marshall on Private Corporations, page 1722, §558 (c).
*372Decided May 3, A. D. 1915. Rehearing denied June 7, A. D. 1915.The judgment is reversed and cause remanded for further proceedings in conformity with this opinion.
Judgment reversed and- cause remanded.
Gabbert, C. J., and White, J., concur.