Opinion by
Mr. Justice Kephart,A mine foreman, after discovering gas in a section of a coal mine, blocked the entrance with a board, and marked on it “gas” to warn workmen against entering that part of the mine. He then gave personal orders to others employed in this particular part of the mine not to go in, and stationed an assistant foreman at the entrance to guard it. A little later this official was obliged to go elsewhere in the mine, but, before leaving, he cautioned claimant and another specially not to go in. They promised to obey his instructions, but the foreman had scarcely left when the men entered the forbidden premises. They attempted to light a fuse that would set off a discharge of dynamite under the coal; instead, the gas was ignited, causing an explosion and the injuries for which this claimant seeks and was allowed compensation.
Under the Act of June 2, 1891, P. L. 176, article XII, rules 5, 7, 58, and article XVII, section 4, workmen are not permitted to enter the part of a mine or working-place that has generated gas until it has been reported safe by the proper officer. A station to prevent entrance into the danger zone must be established at the opening, *87and no one may lawfully pass therein until the gas has been removed. It is the duty of the foreman to stand guard at the warning sign until relieved or until the mine is safe. Any person who fails to comply with these statutory rules is guilty of a misdemeanor. The statute was substantially complied with by the employer in this case.
Under the Workmen’s Compensation Act, an injury' occurring “in the course of employment” is one that is “caused by the condition of the premises or by the operation of the employer’s business or affairs thereon, sustained by the employee, who, though not so engaged, is injured upon the premises occupied by or under the control of the employer, or upon which the employer’s business or affairs are being carried on, the employee’s presence thereon being required by the nature of his employment.”
The question stated by appellant’s counsel is whether compensation will be awarded to a person engaged in the commission of a crime. The inquiry might also be, “Did the injury occur during the course of employment?” When the foreman discovered the gas and took steps to guard against danger, so much of the employer’s mine containing gas ceased to be workable under the law. In the interest of life and safety, a barrier, at the opening, with notice and a guard, was required to be placed around such parts of the mine; work was thereafter by law suspended in that section. Neither the employer nor employee was permitted to enter for the purpose of digging coal so long as that part continued gaseous. The place, in law, was completely isolated. Any employee entering the prohibited ground severed his relation as a servant of the master; he was no longer in the course of employment, but was a free agent openly defying the statutes of the commonwealth. The “employee’s presence thereon” was not “required by the nature of his employment”; as to this danger zone, he had no employment.
*88There can be no legal excuse for failure to obey an absolute statutory requirement: Jones v. American Caramel Co., 225 Pa. 644; Jaras v. Wright, 263 Pa. 486, 490. To sustain the act of claimant “as at best contributory negligence,” which is no defense to a claim under the Workmen’s Compensation Law, is to set up a quasi-legal excuse for the commission of a crime. The offense is not obliterated by the provision calling for punishment, nor by its enforcement. The law will not permit the offender, the penalty paid or unpaid, to otherwise reap substantial fruits from the crime. If we allow a recovery, we force the employer to pay the criminal for an illegal act which may bring death to many in its train.
We have consistently followed a public policy announced long ago by this court; it will not aid a man who grounds his cause on an immoral or illegal act. As stated in Badgley v. Beale, 3 Watts 263, “ ‘Every contract made for, or about, any matter or thing which is prohibited and made unlawful by statute, is a void contract, though the statute itself doth not mention that it shall be so, but only inflicts a penalty on the defaulter.’ The cases of each class, however, are clear and full to prove that where the services were rendered in a transaction which was itself an immediate and direct breach of the laws, an action for compensation cannot be maintained.” See also Seidenbender v. Charles, 4 S. & R. 151, 172; Columbia Bank and Bridge Co. v. Haldeman, 7 W. & S. 233, 234. And as we have unhesitatingly held employers to a strict rule for failure to obey social welfare acts in the interest of safety to other workmen, so also the law as it relates to employees mining coal under these circumstances must be enforced, notwithstanding the distressing features of this accident. It may be mentioned that there occurred in the last few months, in the county of the writer of this opinion, a catastrophy in a gaseous mine due to violation of this act, where three score and more lost their lives. See Kuca v. Lehigh Val*89ley Coal Co., 268 Pa. 163, 167; Callihan v. Montgomery, 272 Pa. 56, 65.
The judgment is reversed, and the record is remitted to the court below with directions to return it to the compensation authorities, so that they may proceed to adjudicate the case in accordance with the law as expressed in this opinion.