Upon the facts found by the Judge at special term, the question is distinctly presented for our determination, whether this court has power to give force and effect tó the plaintiff’s imperfect and defective judgment, and secure to it preference and priority over the defendant’s claims, according to the agreement ánd intention of the parties at the time the judgment was confessed. By the finding, the fact is established, that at the time this judgment was confessed, it was expressly agreed between the defendant therein, and the plaintiff, that the same should have preference over the defendants’ judgments, and all other claims, and that it should be first docketed to secure to it such preference and priority. This agreement was made known to these defendants, and assented to by them; and in consideration of it, the plaintiff incurred new liabilities for and on account of the defendant in his judgment. In pursuance, of the agreement, both the plaintiff’s and the defendants’ judgments were entered and docketed in such a manner in respect to time as to insure priority to the plaintiff’s. The parties all resided, and the property was situated', within the boundaries of Schuyler county, which the parties all then supposed and believed had been legally erected and organized as a county, and the judgments were there docketed in exact accordance with their agreement. Execution was afterwards issued upon the plaintiff’s judgment, and the property .of the defendants therein seized,- by virtue thereof, by the person elected as sheriff of the supposed county. Proceedings upon this execution were .stayed by order of the court, and the *315courts afterwards held and decided that the statute by which said county was attempted to be erected and organized was unconstitutional and void. Consequently the plaintiff’s judgment, not being docketed in a proper place, was never perfected and ripened into a final judgment, upon which a valid execution could be issued. In consequence of this, the whole scheme miscarried, and it became impossible to carry out the agreement hy and through the machinery of the law as the parties contemplated. It remains to be seen, therefore, whether the equity powers of this court are -sufficient to give force and effect to this agreement, and to cause it to be executed according to the intention of the parties, notwithstanding the failure of the legal means and instrumentalities through which they designed it should be done.
Although the statute was found to lack the constitutional force and vigor necessary either to beget or to uphold and maintain the body of a legitimate county organization, the agreement still remained and continued a valid subsisting agreement, capable of being enforced and executed, depending in no respect for its binding force upon the validity of the statute by which the county was sought to be organized.
The failure of the statute broke the machinery by means of which the agreement was to he carried into execution, and affected it to that extent, but did not touch its vital character, as a valid binding agreement. If we have the power, there can be no doubt, I think, but that we should" exercise it, in the plaintiff’s favor, in this case. The process of giving relief will be found to be greatly simplified in the fact that the property, in controversy has been converted into money.
After a careful consideration of the whole question, I have come to the undoubting conclusion that this court is clothed with ample power to effectuate the intention of the parties, and to secure to the plaintiff the benefit of his agreement which he would otherwise inevitably lose through no fault or neglect on his part. This is to be done not in the exact mode contemplated by the parties, hut by other means to be sup*316plied by the court, in furtherance of justice, and to .prevent its entire failure.
It is one of the leading and cardinal maxims of equity, to regard that as already done which parties have agreed should be done, and which .ought to have been done. Story, in his commentaries on Equity Jurisprudence, says: “The true meaning of this maxim is, that equity will treat the subject 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 ; not as the parties might have executed them." (Eq. Jur. § 64, g.)
Upon the same principle, equity constantly treats land as money, or money as land, whenever either is directed' by wills or other instruments to be converted into the other. And in like manner liens, in the nature of equitable mortgages, are decreed and enforced against real and personal estate where security of that character has been promised or intended by the parties, though not in form executed and delivered. Lord Loughborough said, in reference to such cases, in the leading case of Russel v. Russel, (1 Bro. C. C. 269,) “ The court has nothing to do but' to supply the legal formalities. In all these cases the contract is not to be performed, but is executed." In the “American Notes” to the case above cited, (Lead. Eq. Cas. 40, Law Lib. 4th series, 467,) it is said: “ It has been held in many of the courts in this country that an agreement in writing to give a mortgage, or a mortgage defectively executed, or any imperfect attempt to create a mortgage, or to appropriate specific property to the discharge of a particular debt, will create a mortgage in equity, or a specific lien, which will have .precedence of subsequent creditors.” Several cases decided in this country are cited in support of this rule.' Additional cases might be cited, as Haverly v. Becker, (4 Comst. 169;) Craig v. Leslie, (3 Wheat. 563,) and many others, all tending in the same direction.
The case at bar falls clearly within the principle. Here was an attempt to create a lien which should have precedence *317of all others. The agreement was founded in a good and valuable consideration, and the parties undertook to give it effect in good faith. The attempt failed, because-of the failure of the machinery upon which they relied, through a defect in the statute. Under such circumstances, I think it is the plain duty of the court “ to supply the legal formalities ” necessary to secure to the plaintiff the rights intended to be secured to him by the agreement. The defendants are in no respect strangers to this agreement, who have acquired subsequent rights without notice, and in good faith, and do not come within the exceptions to the above rule.
[Monroe General Term, March 5, 1866.It would be unjust, therefore, to permit them to take advantage of the defective docketing of the plaintiff’s judgment, and thus deprive him of the rights and the precedence intended to be secured to him by the agreement, in which all were interested, and all acquiesced.
I am of the opinion that the judgment at the special term was right in all respects, and should be affirmed, with costs.
Judgment affirmed.
Welles, E. D. Smith and Johnson, Justices.]