The opinion of the court was delivered by
Burch, J.:Arthur A. Underwood held a contract of purchase from the Lincoln Land Company of certain real estate upon which there remained a balance due. He was also under obligations to various persons on account of the erection of a house and other *159improvements upon the property. For the purpose of paying the amount due on the land and procuring a deed of it, and for the purpose of discharging his obligations for improvements on the land, he borrowed $900 of the Harlan County Bank. When the loan was made he left his land contract with the bank, and authorized it to procure a deed of the property from the land company. At the same time he agreed orally with the bank that it should hold the contract, and afterward the deed, as security for the loan until a formal written mortgage could be prepared, which he agreed to give. The bank paid the land company, obtained the deed, and paid out the remaining proceeds of the loan for the stipulated purposes. Underwood then refused to execute a mortgage to the bank, and mortgaged the property to the Foster Lumber Company. The lumber company, however, at the time it received its mortgage, had full knowledge of all the rights, claims, interests and equities of the bank, and already had received $300 of the loan direct from the bank on account of its claim for improvements. The land was the homestead of Underwood and his wife.
In an action by the bank for the recovery of a balance due upon its loan it claimed and was awarded a lien on the land superior to that of the lumber company under its mortgage. The lumber company seeks a reversal of that judgment by this proceeding in error.
It is claimed that the transaction disclosed amounted to nothing more than a deposit of title deeds as security for a loan, and, hence, that no lien resulted. The bank, however, pleaded and proved, and the court found, that the deposit of the contract of sale was accompanied by an express oral agreement to give a mortgage. The agreement furnished a sufficient basis upon which, after performance by the bank, to found a lien, and is sufficient to take the *160case entirely out of the category of equitable mortgages arising merely from a deposit of title deeds.
It is further claimed that the bank in its petition relied upon the deposit of the land contract and the taking of the deed from the land company as its security, and not upon the agreement to give a mortgage. The bank, however, simply pleaded the entire transaction as it actually occurred. The fact that the transaction may have included an attempt to create a lien by the deposit of title instruments does not alter or destroy the effect of the promise to give a mortgage. The bank’s theory, in part, may have been that the deposit of the contract and the procuring of the deed to Underwood’s land did give it a lien. It had the right to present the question to the courts; but it did not thereby abandon the right to claim a lien by virtue of the express contract to give a mortgage, which it fully and plainly pleaded. The two claims are not inconsistent. Both have been urged. That of an equitable mortgage is sufficient to sustain the judgment of the district court, and no occasion arises to discuss the policy of the law of this state concerning the other.
Having obtained the bank’s money upon an agreement to give it a mortgage, Underwood should have executed and delivered the promised security. Equity treats that as done which a party under his agreement ought to have done. (Elston v. Chamberlain, 41 Kan. 354, 361, 21 Pac. 259.) The court had no alternative but to apply the maxim in this case. (3 Pom. Eq. Jur., 2d ed., §1237; 1 Jones, Mort., 6th ed., §163; 11 A. & E. Encycl. of L. 125.)
, The fact that the agreement to give a mortgage was oral does not affect the validity of the bank’s lien. It had fully performed its part of the agreement.
“The doctrine of equitable mortgages is not limited to written instruments intended as mortgages, but *161which by reason of formal defects cannot have such operation without the aid of the court, but also to a very great variety of transactions to which equity attaches that character. It is not necessary that such transactions or agreements as to lands should be in writing in order to take them out of the operation of the statute of frauds for two reasons, first, because they are completely executed by at least one of the parties and are no longer executory, and, secondly, because the statute by its own terms does not affect the power which courts of equity have always exercised to compel specific performance of such agreements.” (Sprague v. Cochran, 144 N. Y. 104, 113, 38 N. E. 1000, 1002.)
“That statute was enacted to provide as far as possible against the perpetration of frauds; and courts of equity never allow its provisions to be perverted and made instrumental in the accomplishment of fraud. They decree the specific execution of agreements where there has been a performance on the one side, because the refusal to perform on the other side is a fraud; and they will not permit the statute designed to prevent fraud to be made an engine of fraud. Md. Sav. Inst. v. Schroeder, 8 G. & J. 93, 29 Am. Dec. 528; Hamilton v. Jones, 3 G. & J. 127; Artz & Wife v. Grove, 21 Md. 456; Moale v. Buchanan, 11 G. & J. 314.” (Cole v. Cole and Wife, 41 Md. 301, 304. See, also, Dean v. Anderson, 34 N. J. Eq. 496; Baker v. Baker et al., 2 S. Dak. 261, 49 N. W. 1064, 39 Am. St. Rep. 776; King v. Williams, 66 Ark. 333, 50 S. W. 695; 1 Jones, Mort., 6th ed., §164.)
Besides, it properly may be said that the lien decreed results from the operation of thé law upon the entire conduct of the parties, and hence is in terms excluded from the inhibition of the statute.
“It is claimed by counsel for plaintiff in error, substantially, that an equitable lien on real estate, where it has any real existence, is an interest in land, and cannot be created merely by parol; that the statute of frauds (Gen. Stat. 1868, ch. 43, §5) prohibits such a thing. All of this we agree to; but still the statute of frauds does not attempt to prohibit the creation of equitable liens by operation of law, nor does any other *162statute. (Stevens v. Chadwick, 10 Kan. 406, 15 Am. Rep. 340.) Such a lien should of course be in accordance with the contract and understanding of the parties affected by it, but still it may sometimes result by operation of law from the transactions of the parties almost wholly independent of the contract that may be made between them. It results however from the whole transaction, including all the contracts, agreements, and understandings of the parties, parol or otherwise.” (Curtis v. Buckley, 14 Kan. 449, 456.)
In the case of Sprague v. Cochran, supra, it was said, at pages 112, 114:
“There can be no doubt upon the authorities that where one party advances money to another upon the faith of a verbal agreement by the latter to secure its payment by a mortgage upon certain lands, but which is never executed, or which, if executed, is so defective or informal as to fail in effectuating the pufpose of its execution, equity will impress upon the land intended to be mortgaged a lien in favor of the creditor who advanced the money for the security and satisfaction of his debt. This lien attaches upon the payment of the money and, unless there is a waiver of it, express or implied, remains and may bé enforced so long as the debt itself may be enforced. . . . The whole doctrine of equitable mortgages is founded upon that cardinal maxim of equity which regards that as done which has been agreed to be done, and ought to have been done. In order to apply this maxim according to its true meaning the court will treat the subject-matter, as to collateral consequences and incidents, in the same manner as if the final acts contemplated by the parties had been executed exactly as they ought to have been.”
This being true, the situation of the parties at the time the lumber company took its mortgage was precisely the same as if the contemplated mortgage to the bank had actually been given, and notice to the lumber company of the bank’s rights was equivalent to notice of a prior unrecorded mortgage. Under the recording acts such instruments are valid between the parties and all persons having actual notice of them. *163(N. W. Forwarding Co. v. Mahaffey, Slutz & Co., 36 Kan. 152, 12 Pac. 705.) Hence, the lien of the lumber company was necessarily inferior to that of the bank. (Jones v. Lapham, 15 Kan. 540; 11 A. & E. Encycl. of L. 141.)
The position taken by the lumber company is that the bank was not entitled to any lien whatever in any sum. The attacks made upon the findings of fact and conclusions of law were directed to the complete annihilation of the equitable mortgage sought to be foreclosed. No effort has been made to exclude any of the items utilized in computing the amount of the lien, and the mortgage has been left to stand or fall as an entirety. If, therefore, any part of it be valid as against the claimed homestead character of the premises the judgment cannot be disturbed.
There can be no doubt that, to the extent of the unpaid purchase-price of the land, the bank’s equitable mortgage was a purchase-money mortgage, and, therefore, valid without the consent of Mrs. Underwood, notwithstanding the property was occupied as a homestead. (Const., art. 15, §9; Pratt v. Topeka Bank, 12 Kan. 570; Andrews v. Alcorn, 13 id. 351; Ayres v. Probasco, 14 id. 175; Nichols v. Overacker, 16 id. 54.)
All other assignments of error have been examined and found to be unsubstantial. The judgment of the district court is affirmed.
All the Justices concurring.