delivered the opinion of the court.
This is an action to quiet title to two tracts of land located in the city of Helena, Lewis and Clark county, Montana, only one of which is involved in this appeal, and that is described as follows: “The west twenty-four feet of lot No. 2 and all of lot No. 1 and 6.7 feet, more or less, of frontage by 125 feet in depth immediately west of and adjoining said lot No. 1, all in block 35 of the Lennox addition to the city of Helena, Montana, as said property is numbered and *552designated upon the official plat of said addition on file in the office of the county clerk and recorder of said county.”
The complaint, which is in the usual form in such cases, alleges ownership in the plaintiff; that he and his predecessors in interest for more than ten years immediately before the commencement of the action have been in the open, exclusive and adverse possession of the premises, claiming the same adversely against all persons whomsoever, and that the defendants claim some interest in or lien thereon, which claim is without right, merit, or equity, and wholly unfounded. The prayer is that defendants be required to set forth the nature of their claims, that they be declared to be without right, and that defendants be enjoined from asserting any claim to the premises.
The defendant Henry B. Moore appeared in the action and by his amended answer admitted that plaintiff since July 1, 1916, had been in possession of the described premises, but denied that he was the owner of or entitled to the possession thereof, or that he or his predecessors in interest had been in the open, exclusive possession of said premises or any part thereof, claiming the same adversely to all persons whomsoever for' more than ten years; admitted that he claimed an interest in the premises; but denied that it was without right or merit or unfounded.
For a further answer, and by way of counterclaim, the defendant set forth the following: That on February 15, 1909, Georgiana Godfrey was the owner, in possession, and entitled to the possession of the premises in question, and on that date with her husband gave a mortgage on the same to Morris Weiss to secure payment of their joint promissory note of even date therewith for the sum of $2,185, due in one year, bearing interest at eight per cent per annum, which mortgage was duly recorded in the office of the county recorder of Lewis and Clark county; that on April 26, 1909, the note and mortgage were for value assigned to defendant Moore by an instrument in writing, which was thereafter *553duly recorded, and that no part of said note, either principal or interest; had ever been paid; that Georgiana Godfrey died intestate on January 6, 1914, and her husband, Nathan Godfrey, was appointed administrator ©f her estate on May 10, 1916; that no further action was taken in the administration of said estate, and in October, 1918, Nathan Godfrey died; that about May 1, 1916, the heirs of Georgiana Godfrey, deceased, leased the described premises to the plaintiff for a period beginning on that date and expiring on July 1, 1919, the plaintiff agreeing in lieu of rent to pay the taxes then due or thereafter to be levied and assessed thereon during the term of the lease, and to repair and improve the same; and that plaintiff took possession under said lease.
It is then alleged that on May 27, 1916, the plaintiff entered into a contract with the defendant which recited that defendant was the owner ■ of the note and mortgage above referred to; that the amount due on the note was $2,518, with interest at eight per cent per annum from February 15, 1909; that the mortgage was a first lien upon the described premises, and that the mortgagors were in default; that plaintiff had leased the premises for the term and upon the conditions above set forth; that in consideration of the lease by plaintiff, the payment of taxes, and the making of repairs and improvements, the defendant (1) agreed immediately to proceed to foreclose the above mortgage in the courts of Lewis and Clark county and purchase the property at the foreclosure sale for the full amount of the judgment in lieu of other bidders, (2) gave plaintiff an option or privilege to purchase the premises at any time during the time covered by the lease (which lease was expressly approved and consented to by defendant) upon payment of $2,185, with interest at eight per cent from July 1, 1916, and (3) agreed upon payment of said amount to ■ convey the premises to plaintiff in fee simple and unincumbered, the plaintiff being given the option of paying all or any portion of said amount at any time, and it being provided that interest should be *554paid semi-annually, and also that the plaintiff would pay taxes levied upon the premises during the term of the agreement as they became due. The agreement further recited that it was intended solely for the purpose of giving plaintiff the option or privilege of purchasing the property during the term covered by the lease, and in the event of his failure to do so the agreement was to become null and void and the defendant should be under no obligation to convey nor the plaintiff under any obligation to make the payments. Finally, the agreement was declared to be binding upon the respective heirs, representatives and assigns of the parties thereto.
The answer then alleges that pursuant to the lease the plaintiff took possession of the property on May 1, 1916; that on January 21, 1914, said premises were sold to Lewis and Clark county for taxes assessed thereon for 1913 and a certificate of tax sale issued to the county; that thereafter this certificate of sale was purchased by the plaintiff from the county, and on November 9, 1918, the treasurer of said county executed and delivered to the plaintiff a tax deed for the premises, which was duly recorded; that on June 10, 1916, the heirs of Georgiana Godfrey, “having succeeded to and then having title to said property,” conveyed the same to plaintiff by a quitclaim deed which was duly recorded. It is then alleged that by procuring the tax deed to be issued to him, plaintiff violated his contract with the defendant, and by accepting the quitclaim deed from the Godfrey heirs, he released and relieved defendant from his obligation to foreclose the mortgage, and that the plaintiff held the title thus acquired in trust for the defendant.
The prayer of the’answer is that the plaintiff be adjudged to hold the title to the premises in trust for the defendant and be required to convey the same to him, unless plaintiff within a reasonable time pay to defendant the amount of the mortgage and interest thereon.
Plaintiff filed a general demurrer to the further answer and counterclaim above set forth, which was sustained by the *555court. The case was tried to the court without a jury, findings were expressly waived, and the court gave judgment for the plaintiff, from which this appeal is prosecuted.
The only assignment of error is that the court erred in sustaining the demurrer to the defendant’s counterclaim. Do the facts pleaded in the counterclaim show that plaintiff held the title to the property in trust for defendant Moore ?
We dismiss from consideration the allegation in reference to the tax title acquired by plaintiff, with the statement that both as lessee from the Godfrey heirs and as the owner thereof by conveyance from them he was under legal obligation to pay these taxes, and that by omitting to pay them and subsequently acquiring a tax deed under the tax sale proceedings, he neither added to nor strengthened his title, as such a transaction amounted to nothing more than a payment of the taxes. (37 Cyc. 1346; Moss v. Shear, 25 Cal. 38, 85 Am. Dec. 94.)
The counterclaim affirmatively pleads that the record title to the premises had been in the plaintiff since about June 10, 1916, or nearly five years before the institution of the present suit.
Section 6784, Revised Codes of 1921, provides: “No trust in relation to real property is valid unless created or declared :
“1. By a written instrument, subscribed by the trustee; or by his agent thereto authorized by writing;
“2. By the instrument under which the trustee claims the • estate affected; or
“3. By operation of law.”
There is no contention that the facts pleaded bring the case under either subdivisions 1 or 2 above quoted, and if the plaintiff did stand in the relation of trustee it was only “by operation of law”-—that is, there must have been either a resulting trust or a constructive trust.
*556It is to be observed that the contract pleaded in the answer imposed no legal obligation whatever upon the plaintiff, for it expressly provided that it was “intended solely for the purpose of giving to the party of the second part [plaintiff] the option or privilege of purchasing the property during the term covered by the lease” which he held upon the same from the Godfrey heirs, with which defendant was in no way connected. The contract was strictly unilateral. So far as defendant was concerned, the plaintiff might have abandoned the premises at any time without incurring any liability whatever. Had defendant proceeded to foreclose the mortgage and purchase the property at foreclosure sale in lieu of other bidders and thereby cut out possible creditors’ claims in the Godfrey estate and placed himself in position to convey the property “in fee simple and unincumbered” as he contracted to do, still he could not either in law or equity have compelled the plaintiff to purchase the same from him. There was nothing in the contract to preclude the plaintiff from acquiring title to the premises from someone other than defendant if he could do so, and by the allegations of the answer he did obtain the legal title from the Godfrey heirs.
It is not alleged, either directly or inferentially, that the consideration which plaintiff paid to the Godfrey heirs was paid by or on behalf of defendant and the title thus acquired taken in the name of the plaintiff for the use and benefit of the defendant, and therefore there is no resulting trust pleaded. (Eisenberg v. Goldsmith, 42 Mont. 563, 113 Pac. 1127.)
In Pomeroy’s Equity Jurisprudence, sec. 1044, speaking of constructive trusts, this language is used: “They arise when the legal title to property is obtained by a person in violation, express or implied, of some duty owed to the one who is equitably entitled and when the property thus obtained is held in hostility to his beneficial rights of ownership.”
“The basis of a constructive trust is fraud, actual or constructive.” (15 Am. & Eng. Ency. of Law, 2d ed., 1185.)
*557As above pointed out, the contract in question imposed upon the plaintiff no duty or obligation to the defendant. True, it recites that “in consideration of the lease by the party of the second part, the payment of the taxes and the making of the repairs and improvements upon the premises,” the party of the first part (defendant) agreed to foreclose his mortgage, acquire title, and, at plaintiff’s option, convey the same to him for the considerations mentioned. But the payment of taxes and making of the improvements was the consideration running to the Godfrey heirs in lieu of rent and not an obligation which plaintiff assumed to perform for the benefit of the defendant. Had the plaintiff not purchased from the Godfrey heirs, the tax title which he subsequently acquired would have inured to their benefit and not to the defendant. Under the terms of the contract and the facts pleaded in connection therewith no constructive trust was shown. (Eisenberg v. Goldsmith, supra; MacGinniss Realty Co. v. Hinderager, 63 Mont. 172, 206 Pac. 436.)
The general rules of pleading are applicable to eounter claims. Facts must be stated which constitute a cause of action against the plaintiff, and the sufficiency of the counterclaim must be governed by the same rules as if the defendant had brought suit against the plaintiff. (Sutherland’s Code Remedies, sec. 641.) If on June 27, 1921, at the time he filed his counterclaim, the defendant had commenced a suit against the plaintiff, praying for the same relief which he asked in his answer—that is, that the plaintiff be adjudged and decreed to hold the title of said property in trust for him—and had made no allegations other than those contained in his answer, his complaint would have been fatally defective for the reason that he would not have brought himself under any of the provisions of section 6784, supra.
Upon argument of the case in this court, and by supple- mental briefs subsequently filed, counsel for defendant urge that the decree quieting title to the premises in plaintiff ought not to be sustained without a provision therein re*558quiring payment of the amount alleged to be due upon the mortgage set out in the counterclaim, since plaintiff went into and held possession of the premises as lessee and grantee of the original mortgagor before the mortgage was extinguished by lapse of the time in which an action could have been brought upon the note secured thereby. As above shown, the case was tried before the court without a jury, findings of fact were expressly waived, and the decree finds that the defendant has no right, claim, or interest in or to or lien upon the premises or any part or portion thereof. The appeal is from the judgment, and the evidence introduced at the trial is not here for consideration.
In Leggatt v. Stewart, 5 Mont. 107, 2 Pac. 320, this court held that in an action to quiet title an allegation in the answer to the effect that at the time of the commencement of the action, and for a long time prior thereto, the defendants were and ever since had been the owners, in possession, and entitled to the possession of the premises in controversy, did not constitute new matter, for the reason that all of said facts might have been proven under a proper general denial. In conformity with that decision, under the denials contained in the answer in this case, it was competent for the defendant to introduce evidence of the existence of the mortgage mentioned in the counterclaim. If he failed to do so when he was thus privileged, and thereby deprived the court of an opportunity to afford him appropriate relief, the fault was his and he may not now complain. If, on the other hand, such proof was offered and wrongfully excluded, or if admitted and the court’s conclusions thereon were erroneous, we are not now in position to afford him relief because the testimony is not before us.
Eegarding the portion of the answer designated as a further answer and counterclaim, only as a counterclaim, the court did not err in sustaining the demurrer thereto because it did not state facts sufficient to entitle defendant to the relief prayed for. Should it be considered as simply the plead*559ing of new matter by way of defense, still there was no prejudice in sustaining the demurrer, since, as above pointed out, evidence of the facts therein pleaded in reference to the defendant’s interest in or claim to the premises was admissible under the denials of the answer.
The judgment is affirmed.
Affirmed.
Mr. Chief Justice Callaway and Associate Justices Cooper, Holloway and Galen concur.