delivered the opinion of the court.
The twelfth plea confesses and avoids all the counts in the amended declaration; the fourteenth plea confesses and avoids the first eight counts of the amended declaration, and the fifth additional plea confesses and avoids the last two counts of the amended declaration and the two additional counts—the counts in trespass. The demurrers to these three pleas are general demurrers and if the pleas in substance present a legal defense to the counts to which they are pleaded, then judgment was properly entered in favor of the defendant.
Negligence is the gist of the first eight counts of the declaration. They seek to recover from the defendant because of its negligence in starting a fire to clear the right of way of defendant of inflammable material or for the negligence of defendant in negligently failing to watch said fire after it was started so that it spread and burned the property of plaintiff.
The trespass counts charge the defendant with entering the premises of plaintiff and starting a fire thereon, which destroyed plaintiff’s building and contents. The plea to these counts avers that the servants of the defendant, when they entered the close and set out the fire, did so under the belief that it was a part of the right of way of defendant and without knowing it had been leased to plaintiff, and believing they were burning dry weeds, etc., on the right of way of the railroad as they had been directed to do by the defendant.
All the pleas admit the starting of the fire by the defendant and the destruction of plaintiff’s property as stated, but aver that the plaintiff was only in possession of the premises destroyed, by virtue of a lease from the defendant that contains an agreement that plaintiff will exercise the necessary care to protect his buildings and property from fire and indemnify and save defendant harmless from all liability for damages by fire however the fire may originate, the risk of which is assumed by plaintiff.
Plaintiff contends that such an agreement is illegal and void as against public policy. It is not alleged in the counts in case that the fire was started with the intent or purpose of burning the premises of plaintiff, but only that defendant was negligent in burning the dry grass and weeds, and the plea to the trespass counts avers the fire was started for the lawful and legitimate purpose of destroying’ the dry grass and weeds on the defendant’s right of way; hence what would be the effect of such a contract if a criminal intent had been present is not involved.
The courts of this state have held contracts of railroad companies to be legal and valid, where there was much more reason for holding them invalid and against public policy than there is in the present contract. In C. R. I. & P. Ry. Co. v. Hamler, 215 Ill. 525, it was held that a contract of employment as a porter for a sleeping car company, which releases the railroad company over whose lines the cars are hauled from liability for any injury to the porter when on such lines, is not against public policy, and such a contract is a good defense to an action for any negligence short of wilful or intentional negligence. The same rule is held with respect to a contract with an express company. Blank v. I. C. R. R. Co., 182 Ill. 332. Contracts similar to the contract in question have been held valid and not against public policy. Osgood v. Central Vermont R. R. Co., 70 L. R. A. (Vt.) 930; Mann v. Pere Marquette R. R. Co., 135 Mich. 210; Griswold v. I. C. R. R. Co., 90 Iowa 265; Northern Pacific R. R. Co. v. McClure, 47 L. R. A. (N. D.) 149; Thomas v. Hannibal & St. J. R. R., 82 Mo. 538; Russel v. Pittsburg R. R. Co., 157 Ind. 315; Quirk Milling Co. v. M. & St. P. Ry. Co., 98 Minn. 22; Stephens v. Southern R. R. Co., 109 Cal. 86; C. N. O. & T. P. Ry. Co. v. Saulsbury, 90 S. W. R. (Tenn.) 624; Mansfield M. Ins. Co. v. C. C. C. & St. L. Ry. Co., 74 Ohio St. 30; M. K. & T. Ry. Co. v. Carter, 68 S. W. R. (Tex.) 159; Hartford Fire Ins. Co. v. C. M. & St. P. Ry. Co., 70 Fed. R. 201. The contract was in the nature of an insurance against losses occasioned by the negligence of defendant or its servants. A common carrier may obtain insurance against such losses or may by stipulation with the owner of goods carried have the benefit of such insurance procured by the owner. Phoenix Ins. Co. v. Erie Transportation Co., 117 U. S. 312; Wager v. Providence Ins. Co., 150 U. S. 99.
Plaintiff was not under any obligation to erect the building on the premises leased by him from defendant until he secured from defendant the lease which gave him the right and obligated him to erect it'. He could not compel the defendant to permit him to erect the warehouse on its grounds (Missouri P. R. R. Co. v. Nebraska, 164 U. S. 403), and the defendant in giving a lease of part of its land had the right by contract to protect itself from liability and the indemnity to defendant against damages by fire is a part of the consideration for the granting of the lease. We see no good reason why the defendant might not protect itself by contract against damages by fire resulting from its negligence, since it was not contracting for anything prohibited by law or conflicting with its duty as a common carrier. What the defendant might have refused to permit to be done, it may permit to be done on such terms as it can make by contract without violating the law. The court properly overruled the demurrers to the twelfth and fourteenth pleas.
The plea to the trespass counts admits an entry by defendant upon the close of plaintiff, but denies any intentional trespass and avers plaintiff held said close only as tenant of defendant. It avers that the unintentional entry on the close occurred through the negligence of the employes of defendant, who were only authorized to clear the right of way of inflammable matter. That is an act which section sixty-three of the railroad and warehouse act required the defendant to perform. The plaintiff in the lease agreed to exercise such care and caution and take such precautions as shall adequately protect the building thereon with its contents against all danger by fire. The plea avers that the employes of defendant, after setting out said fire, thought they had put it out and left said close with the fire entirely extinguished, but that it smouldered for, to-wit, two days in sawdust and other inflammable material that plaintiff had allowed to be and remain on said close, and that the fire broke out and was communicated to the.building, etc. The plaintiff negligently permitted sawdust and dry weeds to be and remain on the close leased by it, which was part of the right of way of defendant, and the employees of defendant by mistake and without any breach of the peace entered and undertook to destroy the inflammable material dangerous to the safety of plaintiff’s property and negligently failed to entirely extinguish the fire. The act the defendant did was one plaintiff had obligated himself to defendant to perform, and that the statute requires shall be done by the defendant.
In 28 Am. & Eng. Encye. of Law, 557, the rule announced is: “The mere absence of wilfulness is so little material to the constitution of trespass that, in general, nothing short of unavoidable accident will excuse, and the want of intention to do the particular injury caused, or any injury whatever, will not avail the defendant if the act was an illegal or mischievous one, or a lawful act done in a careless or improper manner, from which injury to third persons may possibly result. But if there be negligence by both parties, there can be no recovery without showing that the damage was wholly caused by the act of the defendant.” And on page 558: “Parties engaged in the prosecution of a lawful act are not liable for an accidental injury occurring during the performance of the act, when due care and precaution have been exercised. * * * But although without the intention to injure, if there be want of ordinary care and skill, even in the performance of a lawful action liability follows. No amount of care will excuse where the act performed is illegal.” The demurrer admits the averments of the plea that plaintiff permitted inflammable matter to be on the part of the right of way leased to it, its failure to protect its buildings from the danger by fire resulting therefrom and the averments as to how the fire was started and the unintentional negligence of the defendant. By the averments of the plea there was negligence on the part of plaintiff in neglecting to perform his agreement to adequately protect his building on the leased premises from danger by fire. The law required the defendant to keep its right of way clear of combustible material. In burning the dry grass, etc., on plaintiff’s close, it appears to have done in a negligent manner what the law required it to do, and the plaintiff had obligated himself to defendant to do, and that by his failure to keep his contract he contributed to the injury for which he brings his action. The only damages claimed are those caused by fire; all such damages are released by the terms of the lease. The defendant as a landlord having unintentionally, although negligently, entered his own premises of which plaintiff was a tenant with a limited use, to do what the law required, we are of the opinion the plea of release from damages caused by negligence in starting the fire sets up a good defense to the counts in trespass and there was no error in overruling the demurrer to that plea. The judgment is therefore affirmed.
Affirmed.