after stating the case. Upon the foregoing statement of facts taken from the record, we think his Honor erred in taxing the defendant with any part of the costs covered by his exception. The taxation and payment of costs are now regulated by statute (Clerk v. Comrs., 121 N. C., 29), and the courts have no power, of course, to adjudge costs against any of the parties to an action otherwise than is indicated in the statute, save perhaps in some cases where the Court may exercise its discretion, but this case is not within any such exception. It is provided by the statute that “costs shall be allowed, of course, to the plaintiff upon a recovery in the following cases: (1) In an action for the recovery of real property, or when a claim of title to real property arises on the pleadings or is certified by the Court to have come in question at the trial. (2) In an action to recover the possession of personal property. (3) In actions of which a court of a justice of the peace has no jurisdiction.” The Code, sec. 525. “Costs shall be allowed, of course, to the defendant in the actions mentioned in the preceding section, unless the plaintiff be entitled to costs therein.” Section 526. “In other actions costs may be allowed or not, in the discretion of the Court.” Section 527. This is an *564action for tbe recovery of real property, and the plaintiff has not only not recovered it, but the legal title which he holds has been decreed to be conveyed by him to the defendant upon compliance by the latter with a certain condition — the payment .of the sum due to the plaintiff. So that, the plaintiff has not “recovered” in the case within the meaning of the statute. Tie sought to recover the land in violation of a parol trust which affected his conscience and required him to surrender the possession of the land and the title upon the defendant’s paying the money due. He denied the trust, and upon the issue raised by this denial he was defeated before the jury. It then became necessary to ascertain the amount due by the defendant, the parties having disagreed as to what it was. For this purpose a reference was ordered, to which order no exception was taken by either party. The bare fact that the referees found that defendant was indebted to the plaintiff in the amount mentioned in their report did not of itself subject the defendant to the payment of any costs — not even to the costs of the reference. In order to determine who should pay the costs, we must consider the general result and inquire as to who has, in the view of the law, succeeded in the action. When a plaintiff sues to recover land and the defendant denies the allegations of ownership and right to the possession and avers that plaintiff holds the land in trust for him, which trust the plaintiff denies, if the trust is established and plaintiff loses what he sued for, can it be said that he has recovered merely because, upon a reference to ascertain the amount due, the referees report a balance against the defendant ? If so, he recovers something that he did not sue for, and which he denied when he brought the action and up to the time of the adverse verdict of the jury belonged to him. A recovery within the meaning of The Code cannot be predicated of anything coining to him which was not in the contemplation of the plaintiff when he *565filed bis complaint, and especially of a thing to wbicb he virtually disclaimed any right or title. The reference and report of the referees were necessary to determine the extent of the defendant’s equity, as the payment of the amount found to be due by him is the condition upon which only the Court will enforce that equity. Instead of the plaintiff having recovered in the action, the defendant has done so, because the plaintiff has failed to get the specific relief he demanded or anything akin to it, and the defendant has been awarded that for which he prayed, although he is re"quired to pay money to the plaintiff, as in the case of a mortgagor redeeming his property. The equity arose out of the promise of the plaintiff to buy and hold the land for the defendant’s use and benefit and to convey it to him when he paid the purchase-money or any balance due thereon, so that the obligation to pay the money was an inherent part of the equity.
In Vestal v. Sloan, 83 N. C., 555 (S. C., 76 N. C., 127), we find a case essentially like ours in its facts. The plaintiff brought suit to recover land and the defendant set up a parol trust, which Avas denied by the plaintiff. The jury found against the plaintiff and an order was made for an account, as the parties differed in respect to the amount due by the defendant. The referee’s report showed that the defendant OAved the plaintiff. Exceptions Avere filed by defendant and overruled, and the plaintiff Avas adjudged to make title to the defendant upon payment of the balance due. Costs were taxed against the defendant and he excepted. The Court reversed so much of the judgment as imposed the costs upon the defendant. In this connection the Court said: “The object of the action instituted Avas the recovery of possession of the land and the establishment of the plaintiff’s legal title in fee thereto. The defense set up Avas a trust attaching to the legal estate and the right to redeem upon pay-*566meat of the residue of the debt with which the laud was charged. Most of the costs were incurred in determining this controversy and the sum to be paid in redeeming, and in this the defendants prevailed and they are allowed to redeem upon payment of what is due. The plaintiff has not recovered the real property claimed in the action, so as to entitle him to recover his costs (The Code, sec. 525, C. C. P., sec. 276), while the defendants have sustained their counterclaim and equity, which is but a reversed action between the same parties in which relief is at once afforded instead of the defendants being forced to seek it in a new suit before an-* other tribunal.” And, quoting from the opinion of Taylor. C. J., in Price v. Sykes, 8 N. C., 87, it is further said: “With respect to costs, they ought to be paid by the defendants (the plaintiffs in the action), since they prosecuted an unjust claim at law and have set up an inequitable defense in this Court.” The Court finally held that the plaintiff had failed in his action and should pay the costs. To the same effect is Currie v. Clark, 101 N. C., 321, where the same questions precisely were involved. The Court in that case sums up the matter in these words: “We think the third exception as to the costs in the Court below must be sustained. The plaintiff failed to recover the land, to recover which alone the action was brought. The defendants alleged and established an equitable defense, which rendered it expedient and just to administer certain equitable rights of the plaintiff, but the latter failed wholly to maintain the action as to the purpose for which it was brought.”
But the plaintiff’s counsel contend that, as the defendant denied that anything was due, he thereby made an accounting necessary and should therefore be taxed with the costs of the reference. The record tends to show that the plaintiff himself did not know what was due, or, if he did, he did not disclose it or claim any particular sum. For this reason a *567reference was necessary. But it seems to ns tbe cases above cited furnish an answer to tbe contention, and further that tbe case of Bruner v. Threadgill, 93 N. C., 225, is decisive of this case. There a mortgagor brought an action to redeem, and the mortgagee resisted his right and lost. A reference was ordered for an accounting, and in order to ascertain the balance due by the mortgagor. A balance was reported in favor of the mortgagee and the usual judgment rendered for the payment of the amount due, and, in default of payment by a certain day, for a sale of the land. The mortgagee was adjudged to be taxed with all the costs. He excepted and appealed. This Court held that a judgment decreeing a sale and allowing the plaintiff in that way to redeem was one in favor of the plaintiff, within the meaning of the law, and affirmed the decision of the Court below.
There is error in the ruling of the Court, and the defendant’s exception is sustained.
Error.