Robinson, J.
*2231 *2242 *222In July, 1866, the defendant, for the consideration of one hundred and fifty dollars, conveyed to the plaintiff forty acres of land, in Webster county. The deed of conveyance contained a covenant in words as follows: “And we covenant to warrant and defend said premises against the lawful claims of *223all persons -whomsoever.” The plaintiff then conveyed the land by warranty deed to Patrick Connors. The title of the defendant'was derived from the act of congress approved September 28, 1850, which granted to the state of Arkansas and other states swamp and overflowed lands within their limits, and through acts of the general assembly of this state. The land was within the limits of the grant made to- the state of Iowa by the act of congress approved May 15, 1856, to aid in constructing a railway from Dubuque to a point on the Missouri river near Sioux City, and was claimed by the beneficiaries of the grant as being a part of it. About the year 1880, William Eagan, a grantee of the railway company which claimed the land, procured, through the government land office, a cancellation of the swamp-land entry, and then obtained from the United States government a certificate of the land to the beneficiary of the railroad grant. At the time of the cancellation of the swamp-land entry, the officials of the land office required that notice be given to interested parties; but none was given to the plaintiff, nor to her grantee, Connors. After the swamp-land entry was canceled, Eagan instituted against Connors an action to recover the land, and obtained judgment for its possession. Connors then purchased the outstanding title. The plaintiff was not made a party to the action, and neither she nor the defendant had any notice of it. After judgment was rendered in the action against Connors, and after he had purchased the outstanding title, he commenced an action against the plaintiff to recover damages for a breach of her warranty to him. In that action she successfully defended the title she had acquired from the defendant, asserting its validity, and claiming that the cancellation of the swamp-land entry was invalid. After the action against her was commenced, she gave *224to the defendant notice of it, and demanded that he appear and defend the title acquired from Mm. He failed to' appear, and she made the defense at a cost to herself of fifty dollars for attorney’s fees in the district court, and fifty-seven dollars and fifty cents attorney’s fees and five dollars as expenses in this court, to which an appeal was taken. She seeks to recover for those sums, and obtained judgment for them in the district court. The appellant contends that, as the title he transferred to the plaintiff was sustained in the action against her, he is not liable on his warranty, while she claims that, as the swampland entry under which he claimed had been canceled, the title under the railroad grant appeared to be superior to that she had acquired from him, and that it was his duty to protect what he had conveyed.
*2253 *224I. The form of warranty given in section 1970 of the Code is as follows: “And I warrant the title against all persons whomsoever.” It has been held to be the same in legal effect as the common-law covenant of general warranty. Funk v. Creswell, 5 Iowa, 63, 82; Rawle, Cov. section 116. That is said to be a covenant “to warrant and defend the title against the lawful adverse claims of all persons whomsoever.” Tiedeman, Real Prop., section 858. In legal effect it is much the same as a covenant for quiet enjoyment Id. section 855. Such covenants do not protect the grantee against every adverse claim or suit, however unfounded, for which the grantor is not responsible, but only against persons making adverse claims based upon a legal foundation. Ackerly v. Vilas, 23 Wis. 222; Gleason v. Smith, 41 Vt. 293; Underwood v. Birchard, 47 Vt. 306; Noonan v. Braley, 2 Black, 499; Devlin, Deeds, section 932. It is not essential to a breach of the covenant of warranty of title that there be an actual eviction. A constructive eviction is sufficient *225Funk v. Creswell, supra; Brandt v. Foster, 5 Iowa, 289; Eversole v. Early, 80 Iowa, 604. The case of Yokum v. Thomas, 15 Iowa, 67, was an action upon the covenants of a deed which are stated to have been that the grantor “is lawfully seized, that he has a good right to convey, that the premises are free from incumbrance, and' that he will warrant and defend.” The facts found were that the grantor had entered the land with a land warrant, and conveyed it to the plaintiff, that afterward an assignment of the location and warrant was obtained from the grantor by fraud, and that upon the assignment so obtained a patent was procured from the United States. The plaintiff commenced an action in equity to set aside the patent, and was successful. He then sought to recover of his grantor the expenses incurred in prosecuting the action. This court held that the covenants of the deed were broken, and the reason upon which that conclusion was based was that when the fraudulent assignee of the location and warrant “obtained the patent from the United States the legal title was vested in her, and upon this title she could have brought her action of right, and, notwithstanding the paramount equities of the plaintiff, could have obtained a judgment evicting her from the premises.” The statement quoted is applicable to the facts in this case. When the swamp-land entry was canceled, and the land had been certified to the beneficiary of the railroad land grant, its grantee held the legal, and apparently a valid, title, which would! have prevailed in a court of law against the equitable title which Connors held from the plaintiff. In other words, there was a constructive eviction, and, under the rule of the Yokum Case, a breach of the covenants of "the deed of the defendant to the plaintiff. He was duly notified of the litigation pending against his *226grantee, and was required to defend the title he had conveyed, but failed to do so. This case and the' Yokum Case are peculiar and distinguishable from most others by the fact that the general government, the source from which the title emanated, with power in the first instance to determine its grantee®, had apparently set aside all acts and proceedings by which the first title was created, and had issued muniments- of title to another grantee. Following the rule in the Yokum Case, we must hold that there was a breach of the covenant of warranty made by the defendant.
4 *2275 *226II. Whether attorney’s fees are a lawful element of damage to be recovered for a breach of the covenant of warranty is a question which does not appear to have been expressly decided by this court. In Yokum v. Thomas, supra, the plaintiff sought to recover for attorney’s fees and costs paid and for time spent. It was not intimated that a recovery for such expenditures could not have been had in a proper case, but it was said that the defendant should have had an opportunity, which he did not have, to protect himself against isuch costs, or to institute proceedings to protect the title he had warranted. In Swartz v. Ballou, 47 Iowa, 188, the plaintiff sought to recover the possession of real estate.' The defendant claimed title under a warranty deed from the plaintiff, and demanded the allowance of á reasonable attorney’s fee on account of the covenant of warranty, for protecting his title. The right to recover such fee was referred to, and it was said that the authorities were not uniform- as to the right of the grantee to recover them unless^ they were taxable as costs. A recovery for such fees was denied in that case, because it was not shown that the defendant had paid, -or was under obligations to pay, any specific sum as attorney’s fees. In Brandt v. Foster, supra, the measure of damage for' *227the breach of a covenant of warranty was considered, but nothing was said in regard to the recovery of attorney’s fees. They were considered in Myers v. Munson, 65 Iowa, 428, but no opinion was expressed as to the right to recover them. The practice of allowing such fees is not uniform, but the weight of authority seems to be iñ favor of allowing them if necessary and reasonable, especially if the warrantor has been notified of the litigation, and given an opportunity to protect Ms warranty. See Eawle, Cov. sections 197-201, and notes ; 2 Sutherland, Dam. 301-309, and notes. We are of the opinion that they should be allowed in this ease. They were absolutely necessary to protect the real against the apparent title. They were made necessary by a defect in the legal title, which the defendant had warranted. Unless they are recoverable, the warranty of the grantee is of no practical value in such a case as this. The expenses for which the district court rendered judgment were reasonable in amount, necessary, and have been paid by the plaintiff. They were incurred after notice' of the litigation had been given the defendant, and he had failed to take charge of it. We conclude that there is no valid objection to the action of the district court in .allowing them, and its judgment is affirmed.