Weaver, C. J.
The evidence tends to show that the private crossing on the plaintiff’s farm was originally protected by a gate in the fence on the margin of the right of way, but the same had become badly rotted, warped, and dilapidated, and was difficult to open and close or to securely fasten. Nearly three months before the accident the gate was opened and left open, according to the plaintiff’s showing, until after the cattle were killed. It is also his claim that the foreman in charge of the railroad told him the gate need not be closed, and that a new one would soon be furnished; but whether this was or was not true, or .whether the foreman had authority to make such statement, we think it immaterial now to consider. Plaintiff’s cattle were placed in a pasture not bordering upon the right of way at this point, but on the night of the accident they broke *9out and wandered to the crossing, where they were struck by a passing train. The ruling of the trial court which is challenged by the appeal was to the effect 'that the act or negligence of the plaintiff in leaving the gate open was sufficient in law to defeat his claim for damages.
1. Railroads-wly^ence: gates. Under our statute (Code, section 2057) it is made the duty of every railroad company to fence its right of way. The same section provides that, to be regarded sufficient, such fence, when made of barbed wire, shall have at least five wires placed upon posts not more than twenty feet apart, the top wire being fifty-four inches from the ground"; and, when of boards, shall have at least five boards securely nailed to posts not more than eight feet apart, and be of the height above mentioned. No express mention is made of gates, but it is a reasonable implication that it is the duty of the company to erect and maintain gates where a suitable open crossing is not provided, and that such gates shall be of a weight, strength, and efficiency corresponding to the legal requirements for a railway fence. Mackie v. Railroad, 54 Iowa, 540.
2. Same-, failure to fence: injury tó Stock: liability. When a railway company fails in the duty thus imposed to protect its right of way against intrusion, by erecting and keeping in repair fences and gates (where gates are required), substantially such as are described • • in section 2057, above cited, it.becomes liable . . 7 for all injuries resulting from such, failure to domestic animals entering upon said right of way, unless it shall appear that the injury was occasioned by the willful act of the owner himself. Code, section -2055. In other words, when the company provides and maintains fences and gates such as the law requires, its duty is done, and if the landowner by his own act, whether willful or negligent, leaves a gate open through -which his animals enter upon the right of way to their injury, he has no recourse upon the company. But if the company does not perform *10its duty in this respect; and its fence or gate is not up to the standard of efficiency which the law prescribes, then it is absolutely liable for all damages thereby resulting to all domestic animals, save only where the injury is chargeable to the willful act of the owner, and it is only necessary to prove the loss or injury in order to make a prima facie case for a recovery. Contributory negligence of the owner, no matter how clearly it appears, will not defeat his action. Therefore, to justify a directed verdict for the defendant, it being admitted that the cattle were killed hy a passing train, it must be shown without substantial dispute that the gate was such as the law required, and was left open by the act or negligence of the plaintiff; or, if the gate was not such as the law requires, that the plaintiff by his own willful act exposed his cattle to the injury which they sustained.
As to the first alternative, it is very clear under the evidence that the court could not say as matter of law that the gate sufficiently complied with the statutory requirement, or that when closed the fence of which it formed a part was a sufficient fence. There was evidence, as we have already noted, that the gate was, and for a long time had been, warped and broken, and was “ somewhat rotten.” The cleats on which it originally hung were both broken off, so that when closed it rested on the ground. To use the language of one witness, there were “ several hoards half rotted off. The whole of it was decayed.” Others say that, by reason of its weight and dilapidated .condition, 'it was difficult to properly open and close it. If the jury believed this testimony (as it had a right to do), it could properly find that the railroad track was not fenced as required by law, and therefore that plaintiff was entitled to recover, unless the injury to his property was chargeable to his own willful act.
*113. Same: of owner: of fact. *10We are thus brought to the question whether the record shows a state of facts which required the court to hold as a matter of law that the injury was so caused. It must be *11borne in mind that, if the fence was insufficient, plaintiff was under no obligation to do more than prove the injury of his cattle on the track, He was not required to negative willful agency on his part. That was a matter of defense upon which the company had the burden of proof. Spence v. Railroad Co., 25 Iowa, 141. “Willfulness,” as here used, means something more than mere oversight, carelessness, neglect, or even shiftlessness. True, in the legal sense of the word, an intentional act is ordinarily willful; but the intentional act in opening a gate or leaving it open does not necessarily imply an intention that cattle shall pass through such gate upon the railway track. This is quite clearly true in a case like the present, where the cattle were not kept or pastured in the field or lane adjacent to the gate, and they' obtained access to the open gateway only by breaking out of a distant field in which they had been placed.
This distinction has been frequently affirmed in our decisions. Nor instance, where swine enter upon an unfenced railroad track and are there killed, it is no defense to show that their owner allowed them to run at large, in violation of law. Spence v. Railroad Co., 25 Iowa, 142. We there said: “ This liability exists, regardless of the question of negligence. Indeed, the statute expressly declares that liability to eiist, unless the injury was occasioned by the willful act of the owner or his agent. If the plaintiff had driven his hog upon the track, or had permitted him to escape for the purpose of going upon the track, such acts, being willful, might well be held to have occasioned the injury, and therefore defeat a recovery. But there is no such showing. The only fact shown was that the hog was at large, contrary to the regulation of that county. This alone will not defeat the plaintiff’s right to recover.” This holding was reaffirmed in Krebs v. Railroad Co., 64 Iowa, 670, where we said that willfulness, in this connection, “ implies something more than mere negligence. It is *12an act in some way connected with- the injury, such as driving the live stock upon the track, permitting it to escape for the purpose of going upon the track, or the like.” In Unix v. Railroad Co., 114 Iowa, 508, plaintiff’s horse broke down a gate in the railroad fence, and plaintiff left it in the broken condition intending to notify the section foreman to make the necessary repairs. Two days later, calves belonging to the plaintiff passed through the opening thus •made in the gate and were killed upon the track, and we there held that, while his act or omission may have been negligent, it was not willful, within the meaning of the statute. In Stewart v. Railroad Co., 32 Iowa, 561, the court again attempts to define “ willful ” as used in this particular statute, saying: “ A willful act is an obstinate, stubborn, perverse, act; and an act done willfully is one done stubbornly, by design, with set purpose.” See, also, Lee v. Railroad Co., 66 Iowa, 131.
"We think, therefore, that if plaintiff, in leaving the gate open, had no intention or purpose thereby to permit his cattle to go upon the track or to expose them to the injury which they sustained, he cannot be said as a matter of law to have willfully occasioned the damage ■ for which he now seeks to recover, even though his act was negligent, and the accident might possibly not have occurred but for his said act. The inquiry whether a given act is willful or otherwise, depending, as it ordinarily does, upon inferences to be drawn from all the circumstances attending and characterizing such act, is peculiarly a matter for the consideration of the jury, and it can seldom, if ever, be determined by the court, as a matter of law. In our judgment, the question of whether the gate when closed afforded a fence substantially such as the law requires, and, if not, then the further question whether plaintiff by his own willful act •occasioned the injury to his cattle, were matters of fact on which he was entitled to go to the jury, and that the per*13emptory direction of a verdict in tbe defendant’s favor constitutes reversible error.
A new trial must be granted, and the judgment appealed from is therefore reversed.