
31 Ill. App.2d 450 (1961)
176 N.E.2d 675
City of Chicago, a Municipal Corporation, Plaintiff-Appellee,
v.
J. Larson, as Trustee Under Trust No. M1, Whiteley Estates Corporation, a Corporation, David Husman and James Hurd. On appeal of James Hurd.
Gen. No. 48,304.
Illinois Appellate Court  First District, Third Division.
June 7, 1961.
Rehearing denied August 16, 1961.
*451 Fried, Husman & Fink, of Chicago (Bernard Allen Fried, of counsel), for appellant.
John C. Melaniphy, Corporation Counsel, of Chicago (Sydney R. Drebin and Rita Ivy Epstein, Assistant Corporation Counsel, of counsel), for appellee.
MR. JUSTICE DEMPSEY delivered the opinion of the court.
This was a chancery action to compel the defendants to permit officials of the Building Department of the City of Chicago to inspect a building of 35 dwelling units at 2444-48 South Michigan Avenue, Chicago. The purpose of the inspection was to determine if the building conformed to the regulations of the Municipal Code.
Four defendants were named in the complaint. No process was taken out as to J. Larson, trustee. Whiteley Estates Corporation and David Husman were dismissed after testimony that they had no interest in the building. An injunction was issued against the fourth defendant, James Hurd, after the attorney for the City said he was prepared to prove that Hurd had denied the City admission to the building, and after Hurd's attorney, who was called as a witness by the plaintiff, testified that he thought Hurd was the resident manager of the building. The injunction restrained Hurd from interfering with the inspection. As grounds for reversal Hurd urges that the complaint *452 was insufficient to support the court's action and that an injunction should not have been issued to enforce an ordinance which provides penalties for its violation.
The complaint was based on information and belief, and charged that conditions in the building violated the minimum standards of health and safety required by the City's ordinances. It stated that the Commissioner of Buildings of the City (whose affidavit, of the truth of the matters alleged, accompanied the complaint) had received many complaints, had made numerous attempts to inspect the premises but had been refused admittance by the defendants. It alleged that an emergency existed because of imminent dangers to the occupants and to the community, and that immediate action was required to protect the health, safety and general welfare of the City's residents.
The relevant section of the ordinance was set forth which gives the City the right to enter and examine any building and which makes it unlawful for any person to interfere with the inspection. The Municipal Code of Chicago, sec. 39-9 (1960). Another section was referred to [sec. 39-3] which provides a fine of $5.00 to $200.00 for each day there is interference with the enforcement of the code. Also quoted was the statute which provides that if, upon due investigation, it is determined that any building fails to conform to the minimum standards of health and safety required by a municipality, and if the owners, after due notice, fail to make it conform, an injunction may be sought to compel compliance. Ill. Rev. Stat., ch. 24, sec. 23-70.3 (1959).
Hurd filed an anomalous answer. It stated that he had no interest in the building except that he and his family resided there; but it then went on to deny the allegations of the complaint, to assail it as defective and to attack the ordinance as unconstitutional. The chancellor took the position that proof in support of *453 the complaint was unnecessary in view of Hurd's answer. The chancellor observed that if Hurd had no interest in the property he was in no position to contest the City's prayer for relief, except as to his own apartment. Hurd declined the court's invitation to make an offer of proof. The injunctional order excluded his apartment from inspection.
[1] No motion was made to strike the complaint but the answer criticized it for lack of facts and for conclusions of law and fact. The allegations in the complaint concerning the existence of an emergency and the requirements for immediate action were indeed conclusions not predicated on pleaded facts nor on specific building code violations. The complaint was deficient in detail, however it appeared to be as complete as the nature of the case allowed. Under the circumstances the City had to proceed on information and belief; until an inspection was made it could not be expected to make positive and more detailed averments. Where the facts are of necessity within the defendant's knowledge and not within the plaintiff's knowledge, but are stated by the plaintiff to be true, a complaint is not perforce defective. 21 I.L.P. Injunctions, sec. 162.
The complaint was not founded upon the statute alone. The citation of the statute and the quotation from it may be regarded as surplusage. The statute would have applied if the City, after investigation, had given due notice of the violations to the owners and if the owners failed to correct them. The City then could have proceeded under the statute against those responsible for the violations. This was not the case here. While the ultimate purpose of the present procedure was to compel the defendants to comply with the building code, the immediate purpose was to obtain access to the premises to ascertain if there was noncompliance with the code. Making an inspection *454 was a right the City had under its ordinance and was a duty owed to its citizens in protecting them from possible hazards to health and safety.
[2] The ordinance is quasi-criminal in character and provides a penalty for those who interfere with its provisions. The general rule is that a court of equity will not enjoin the commission of a crime. Stead v. Fortner, 255 Ill. 468, 99 N.E. 680; People ex rel. Barrett v. Fritz, 316 Ill. App. 217, 45 N.E.2d 48. However, there are exceptions to this rule and under certain circumstances equity will enjoin criminal and quasi-criminal acts. Burden v. Hoover, 9 Ill.2d 114, 137 N.E.2d 59. One of these exceptions is where the act complained of constitutes a menace to the public health, safety or welfare, and where the enforcement of the criminal law is merely incidental to the general relief sought. Village of Spillertown v. Prewitt, 21 Ill.2d 228, 171 N.E.2d 582; Burden v. Hoover, supra. In City of Aurora v. Warner Bros. Pictures Dist. Corp., 16 Ill. App.2d 273, 147 N.E.2d 694, the court said:
"In our opinion courts of equity in Illinois have power to enjoin criminal or immoral acts even though the offenders are amenable to prosecution and no property rights are involved, in order to protect citizens from public wrongs and to protect the public health and welfare."
A situation analogous to our present one prevailed in People v. Huls, 355 Ill. 412, 189 N.E. 346. There the defendant refused to permit representatives of the Illinois Department of Agriculture to inspect and test his cattle. The State prayed for an injunction but a demurrer to the bill was sustained. The Supreme Court in reversing found that testing cattle for diseases dangerous to human beings was reasonably necessary for the protection of the public health; that the act of the defendant in interfering with the inspectors' *455 efforts to make the tests, and in interfering with the enforcement of the law, constituted a public nuisance which equity could enjoin. The court said:
"While it is a general rule of law that where the acts complained of constitute a breach of the criminal law, courts of equity will not for that reason, alone, take jurisdiction to enjoin the further continuance or prevention of threatened illegal acts, yet where the enforcement of the criminal law is merely incidental to the general relief sought and the acts complained against constitute a nuisance or danger to the public health and public welfare and a more complete remedy is afforded by injunction than by criminal prosecution, a court of equity will, on the request of the duly constituted authority, grant the relief sought by injunction."
[3-5] The building code of Chicago is designed to protect the occupants of buildings and the public generally. By refusing to admit inspectors to the premises the defendant was preventing enforcement of the code. If there was imminent danger, as the complaint alleged, prosecuting him would be of little help in allaying the danger. Repeated fines might break his resistance  but they might not. In the meantime, the danger could continue to the jeopardy of the public. Punishing him would be but incidental to the relief required. The public need not be helpless in such a situation. A municipality, operating within its legislatively bestowed police powers, should not be rendered impotent in its legitimate effort to enforce laws protecting the safety, health and welfare of the public. Equity looks to the substance and not to the form, and the underlying purpose of this complaint was not to prevent the commission of a criminal offense, but was to prevent interference with the City's obligation to *456 protect its citizens. The injunction was properly issued.
The order of the Superior Court will be affirmed.
Affirmed.
SCHWARTZ, P.J. and McCORMICK, J., concur.
