It is conceded that the present is not an action for use and occupation. Por no relation of landlord and tenant is alleged to have existed between plaintiff and defendant. Nor did the defendant hold by the permission of the plaintiff. Nor is it an action of trespass. For it is not averred that the plaintiff was ever in the possession of the premises; only that he was the owner, and entitled to "the possession of them. Nor is it averred that there was any wrongful entry or ouster by defendant. Nor is the action in the nature of suggestion under the statute for the mesne profits after a recovery in ejectment. For there has been no such recovery as to these premises, as was required by 2 Rev. Stats., 311, § 44, &c. And it is not shown that the plaintiff ever recovered possession of the premises, so as to warrant his resorting to the old action of trespass for the mesne profits. (Leland v. Tousey, 6 Hill, 328, 330). It does appear, however, that defendant entered into possession of the lands, claiming title thereto.
The plaintiff contends that, in this case, as in many others, where one person has received money to which ex cequo et bono, another is entitled, the law will imply a contract to pay it over to the person lawfully entitled to receive; and such person, being entitled to an election of actions, may waive the tort, and sue upon the implied contract.
No authority is cited, however, and no principle is referred to, which extends the right of election of actions so far as to try, under the form of an action for money had and received, a right or claim to real estate, or to its possession, or to rents and profits. For such, it seems to me, will be the effect of sustaining the present action. The court are to say whether, ex ceguo et bono, the defendant was entitled to the rents he received; when his only title to receive or to hold them arises from an estate which he claims in the land. Before the equity or inequity of his claim to the moneys can be decided, the court must decide who is the real owner of the land.
The case of the City of Baltimore v. White, (2 Gill, 444,) does not sustain any such position. There the legislature had granted a right to make wharves, &c., on the city basin, by consent of the city council; and the city council gave such consent on condition that its exterior margin should constitute *461a public wharf, on which wharfage should be payable to the city. It was held, that the owner of the premises, by building in accordance with the permission granted him on such condition, would be presumed to have assented thereto; that a purchaser from him would be presumed to have notice of the same and was bound thereby; and that if such purchaser should himself demand and receive such wharfage, the city could recover the same in assumpsit for money had and received. The foundation of the action is the implied contract arising from the acceptance of the conditional consent given by the plaintiffs to the building of the wharf.
So in the case of Cummings v. Noyes, (10 Mass., 433). It was in that case held, that the tenant in a real action, against whom judgment had been recovered, under which judgment the demandant went into possession, might, after the reversal of the judgment by a writ of error, recover the mesne profits of the demandant in an action of assumpsit. But the court expressly say that the circumstances of the case raise the presumption of a contract. They say that where a party recovers a judgment in ejectment, and enters by virtue of that, under a known liability to account for the issues and profits, if the judgment should be reversed, he undertakes accordingly. It may be added that the pleadings in that case showed that it could not be necessary to decide the question which party had a title to the lands in question, in order to determine whether or not it was inequitable and unjust that the defendant should keep the moneys sued for.
The case of O’Conley v. The President &c. of Natchez, (1 Smed. & Marsh., 31,) does not warrant the present form of pleading. In that case an intruder or trespasser upon a wharf had collected wharfage, and it was held that the owner of the wharf might waive the trespass and recover the amount thus collected, in an action for moneys had and received.
The court say, “ the plaintiff’s right was fully established, and there is nothing which shows that he was turned out, or yielded possession of the landing. On this view, the defendants were mere intruders or trespassers in collecting that which belonged to another. In such cases, the action for money had and received will lie.” The case was before the court upon a *462bill of exceptions, containing the evidence at the trial, from which it appeared that no question could arise as to the title to the wharf itself.
Judgment must be rendered for the defendant on the demurrer, with costs ; with leave to the plaintiff to amend within twenty days on payment of costs.