
    GULF REFINING COMPANY v. J. T. McKERNAN, Building Inspector of the TOWN OF SANFORD.
    (Filed 17 March, 1920.)
    1. Mandamus — Public Officers — Municipal Corporations — Unlawful Purposes.
    Performance of a mere ministerial duty on the part of a public official, when arbitrarily refused, may be enforced by mandamus and, under some conditions, the issuance of a building permit, under our statutes applicable, may come within the principle, but not for the performance of an unlawful act or one in furtherance of an unlawful purpose.
    2. Same — Gasoline—Oils—Governmental Powers.
    Police regulations as to the erection of structures for the only purpose of carrying on the business of selling and distributing kerosene oil and gasoline and other petroleum products is within the governmental powers ordinarily possessed by cities and towns.
    S. Same — Building Inspectors — Ordinances—Defenses—When Available.
    A permit was requested of a city to erect structures therein to carry on the business of distributing and selling kerosene oil,' gasoline and other petroleum products, and pending investigation by the proper city authorities, a proceeding for mandcmws to compel the issuance of the permit was brought against the building inspector, which was tried in the Superior Court, the judgment appealed from and remanded by the Supreme Court for further findings of fact as to the existence of certain ordinances relative to the inquiry, whereupon two ordinances passed by the proper city authorities forbidding, among other things, buildings of this character, “nearer than one thousand feet from any dwelling,” etc., which forbid the erection of the structures at the proposed location, having been put in evidence and included in the findings of fact. Eeld, 
      the ordinance was a valid one and thereunder the building of said structures at the place being unlawful-; the mandamus must be denied on the second trial; and Held further, this defense was available to the city when brought to the attention of the Court, though the ordinances had been passed since the institution of -the suit.
    ApplicatioN for mandamus, beard before Oormor, J., at October Term, 1919, of Lee.
    Tbe application is for a writ "commanding tbe building inspector of tbe town of Sanford to issue a permit to plaintiff to erect certain structures in said town for tbe purpose of carrying tbe business of distributing and selling kerosene oil, gasoline and greases, and other petroleum products, etc.
    On a former appeal, tbe cause was remanded for further findings of fact, more especially in reference to tbe existence of certain ordinances of tbe town of Sanford deemed relevant to tbe inquiry. 8. c., 118 N. C., 82.
    Pursuant to that opinion, tbe court, on a further bearing, finds that tbe following ordinances of tbe town were passed, and are now in force on tbe subject, in terms as follows:
    “Be it resolved by tbe board of aldermen of tbe town of Sanford, N. C.
    “Section 1. That it shall be unlawful for any person to install, build, construct, or erect, alter or repair any tanks, buildings, or other structures in which gasoline, oil, kerosene, or any other highly inflammable substance is stored for distribution and sale, nearer than a thousand feet from any dwelling or .in any residential section witbjn tbe corporate limits of tbe town of Sanford, North Carolina: Provided, however, nothing in this ordinance shall apply to underground tanks built in tbe earth, or located inside mercantile establishment from which gasoline, oil and kerosene, or any other oils are sold or retailed. Any person violating any of tbe provisions of. this ordinance shall, upon conviction before tbe mayor, be fined fifty fiollars ($50), and each day said structures remain or are used shall constitute a separate offense hereunder.
    “Sec. 2. This ordinance shall he in force from and after its passage.
    “Passed 15 July, 1919.
    “Be it ordained by the board of aldermen of the town of Sanford, N. C.:
    “Section 1. That it shall be unlawful for any person to store gasoline or other highly inflammable, combustible, or explosive oils or substances in tanks or other structures situate nearer than 1,000 feet from any dwelling, residence, or building used as such, within the corporate limits of the town of Sanford: Provided, however, that this ordinance shall not apply to underground tanks, or tanks inside of mercantile establishments in which gasoline,’ kerosene, or other oils are sold or retailed.
    
      “Sec. 2. Any person violating any of tbe provisions of this ordinance shall, upon conviction before tbe mayor, be fined $25: Provided, however, eacb day sucb structure or tank shall be used for storage purposes shall constitute a separate offense hereunder,
    “Sec. 3. That this ordinance shall be in force and effect from and after 1 October, 1919.”
    And that the proposed structures to be used for the company’s business will be within the distances as prescribed and prohibited by the ordinances, but there is nothing in the structures themselves or the plans and specifications therefor which violates any law or ordinances of the State or town of Sanford.
    The court thereupon gave judgment that the writ issue, setting forth his conclusion and the reasons therefor as follows:
    “Upon the foregoing facts the court is of the opinion that no discretion is vested in the defendant as building inspector of the town of Sanford, as to the issuance of the permit for the erection of said structures, • but that the issuance of said permit is a ministerial act to be performed by the defendant in accordance with the provisions of sec. 2986 of the Revisal.
    “The court is further of the opinion that the issuance of such permit will not authorize or empower the plaintiff or any other person to occupy or use the structures on the said lot in violation of law or in violation of any ordinance now in force or hereafter enacted by the board of aider-men of the town of Sanford.
    “Thereupon, upon the motion of attorneys for the plaintiff, it is ordered, considered, and adjudged that the: defendant issue or cause to be issued to the plaintiff a permit, permitting him to erect on the lot described in the application the structures therein specified.”
    Defendant excepted and appealed.
    
      Sinclair & Bye and Hoyle & Hoyle for plaintiff.
    
    
      Williams & Williams for defendant.
    
   Hoke, J.

From the admissions in the pleadings and findings of fact made by his Honor, it appears that plaintiff is a corporation engaged in distributing and selling kerosene oil, gasoline, and other petroleum products, and for the purpose and with the intent of carrying on its business within the corporate limits of the town of Sanford, on 14 June, 1919, applied to the building inspector for a permit to erect in said town, on the corner of the Southern Railway right of way and Weather spoon Street, certain described surface structures, including “3 steel tanks on brick piers, 20 x 40 frame warehouse offices, pump house, etc., together witb all pumps, engines,- pipe lines, fences, and equipment necessary for the conduct of the company’s business.” That, owing to the fact that the city government was at the time examining into the matter with a view of determining whether this was a proper business to be carried on within the corporate limits, etc., the application was not then given. Whereupon, on 3 July, 1919, plaintiff instituted this proceedings for a mandamus to compel performance of the alleged duty. Pending the suit, the board of aldermen, having in their judgment ascertained by inquiry of the State Insurance Commissioner, the officials of adjoining towns where such structures had been erected and used, and others, that the proposed business and buildings, etc., would be highly inconvenient and annoying to adjacent owners and citizens generally, and import menace to lives and property, passed the ordinances hereinbefore set out.

In reference to the ordinances, the court finds that the business and structures on the site as designated will come within the distances prescribed and prohibited by the ordinance but, finding also that there is nothing in the plans and specifications of the buildings themselves that are violative of the general State and municipal regulations as to buildings, and being of opinion, therefore, that there was a ministerial duty permitting no discretion on the part of the inspector, gave judgment that the writ issue, and defendant, the inspector, appealed.

It is undoubtedly true that performance of a mere ministerial duty on the part of a public official, when arbitrarily refused, may be enforced by mandamus, and, under some conditions, the issuance of a building permit, under our statutes appertaining to the subject, may come within the principle. County Board of Education v. State Board, 106 N. C., 81; Hartman v. Collins, 106 N. Y. Supr. Ct., 11. But it is also fully recognized that the writ of mandamus will not be issued to enforce the performance of an unlawful act nor one in furtherance of an unlawful purpose. Betts v. Raleigh, 142 N. C., 229; Godwin v. Carolina Tel. Co., 136 N. C., 258; Hall v. State, 82 Ala., 563; Chicot County v. Kruse, 47 Ark., 80; State ex re Ry. Co. v. Latrobe, 81 Md., 223; State ex re Matheny v. County Ct. Wyoming, 47 W. Va., 672.

In Godwin v. Tel. Co. the application was to compel the installation of a telephone in a bawdy house, and it was held that the writ must not lie, and the present Chief Justice, delivering the opinion, said: “But while it is true that there can be no discrimination where the business is lawful, no one can be compelled or is justified to aid in unlawful undertakings.” And in the annotations of this case appearing in 6 Anno. Oases, 203, the general principle is stated as follows: “It is well settled that mandamus will not lie to compel the performance of acts which are illegal, contrary to public policy, or which tend to aid an ■unlawful purpose,” citing numerous authorities. These building regulations appearing chiefly in our statute on towns, Rev., ch. 73, sec. 2896 et seq., are of general application, to be followed and allowed only when the business to be conducted therein is lawful, and are subject in this respect to the police powers conferred by this and other laws on municipal governments for the public good. State of Mo. ex re Gas Co. v. Murphy, 170 U. S., 78. In this instance, it appears that the avowed and only purpose of erecting these structures is to carry on the business of selling and distributing kerosene oil and gasoline and other petroleum products; a purpose not only evidenced by the character of the building, but so expressly stated in the complaint.

The subject is well within the governmental powers ordinarily possessed by this and other cities and towns. Hudachick v. Los Angeles, 239 U. S., 394; Reinan v. Little Rock, 237 U. S., 171, and the municipal authorities of Sanford, having formally passed ordinances by which the proposed business is made unlawful, under the principle of the decisions heretofore cited, we are of opinion that the application for mandamus should be denied. And such a defense is available though it may have arisen since the institution of the suit.

The act having become unlawful, the position may be made effective at any time pending the proceedings when it is properly brought to the attention of the Court. Williams v. Hutton, 164 N. C., 216; Brinson v. Duplin Co., 173 N. C., 137; Wikel v. Comrs., 120 N. C., 451; Hall v. State, 82 Ala., 563.

On the facts present, we are of opinion that the application must be denied, and it is so ordered.

Reversed.  