
61 S.E.2d 897 (1950)
232 N.C. 629
CITY OF RALEIGH
v.
FISHER et al.
No. 453.
Supreme Court of North Carolina.
November 22, 1950.
*900 Wm. C. Lassiter and James H. Walker, Raleigh, for plaintiff, appellee.
John W. Hinsdale, Raleigh, for defendants, appellants.
ERVIN, Justice.
The appeal is from a judgment on the pleadings. A court of record has inherent power to render judgment on the pleadings where the facts shown and admitted by the pleadings entitle a party to such judgment. 49 C.J., Pleading, section 944.
A motion for judgment on the pleadings is in the nature of a general demurrer. Pridgen v. Pridgen, 190 N.C. 102, 129 S.E. 419. Its function is to raise this issue of law: Whether the matters set up in the pleading of an opposing party are sufficient in law to constitute a cause of action or a defense. Adams v. Cleve, 218 N.C. 302, 10 S.E.2d 911.
When a party moves for judgment on the pleadings, he admits these two things for the purpose of his motion, namely: (1) The truth of all well-pleaded facts in the pleading of his adversary; and (2) the untruth of his own allegations in so far as they are controverted by the pleading of his adversary. Oldham v. Ross, 214 N.C. 296, 200 S.E. 393; Churchwell v. Branch Banking & Trust Co., 181 N.C. 21, 105 S.E. 889; Alston v. Hill, 165 N.C. 225, 81 S.E. 291; Helms v. Holton, 152 N.C. 587, 67 S.E. 1061.
For this reason, a motion for judgment on the pleadings constitutes an *901 appropriate remedy where the pleading of the opposite party is so fatally deficient in substance as to present no material issue of fact. Town of Dunn v. Tew, 219 N.C. 286, 13 S.E.2d 536; Penny v. Ludwick, 152 N.C. 375, 67 S.E. 919. A plaintiff is entitled to judgment on the pleadings where the answer admits every material averment in the complaint and fails to set up any defense or new matter sufficient in law to defeat his claim; and a defendant is entitled to judgment on the pleadings where the complaint fails to state a good cause of action in favor of the plaintiff and against the defendant. Smith v. Smith, 225 N.C. 189, 34 S.E.2d 148, 160 A.L.R. 460; Mitchell v. Strickland, 207 N.C. 141, 176 S.E. 468.
The first issue of law raised by the plaintiff's motion for judgment on the pleadings is whether the admitted acts of the defendants constitute a violation of the zoning ordinance of the City of Raleigh.
Although the zoning ordinance of November 9, 1944, professed to repeal the zoning ordinance of April 20, 1923, it simultaneously re-enacted in substantially the same terms the provisions of the old ordinance requiring building permits and certificates of occupancy, prescribing permitted uses of property in residence districts, and prohibiting the establishment or maintenance of businesses in residence districts. This being true, these provisions have been in force at all times since their original enactment on April 20, 1923; for it is well settled "that where a statute is repealed and all, or some, of its provisions are at the same time re-enacted, the re-enactment is considered a reaffirmance of the old law, and a neutralization of the repeal, so that the provisions of the repealed act which are thus re-enacted continue in force without interruption, and all rights and liabilities thereunder are preserved and may be enforced." 50 Am.Jur., Statutes, section 555; Brown v. Brown, 213 N.C. 347, 196 S.E. 333.
The answer admits that the premises at 2512 Everett Avenue have been located in a residence district of the City of Raleigh since 1923; that the defendants have been conducting a commercial business upon such premises since 1938; and that the building inspector of the City of Raleigh has never issued a certificate of occupancy authorizing the defendants to use such premises for any purpose. Hence, the pleading of the defendants makes it plain that they are now, and ever since 1938 have been, engaged in a two-fold violation of the zoning ordinance of the City of Raleigh.
Sections 10, 26, and 28 of the ordinance of November 9, 1944, have no application to this litigation. As the defendants have been acting in contravention of the zoning regulations at all times since 1938, it can not be said that they are simply continuing a use of the premises which was legal at the effective date of the new ordinance or at any other time. The building permits authorized the feme defendant to erect the building at 2512 Everett Avenue for a "designated or intended use," to-wit, a residence. The plaintiff does not prosecute this action against the defendants to "repeal, abrogate, annul, or in any way impair or interfere with" such building permits, or to "require any change in the plans, construction, (or) designated or intended use" of the building erected under them.
The second issue raised by the plaintiff's motion for judgment on the pleadings is whether the City of Raleigh is estopped to enforce its zoning ordinance against the defendants by the fact that its officials have encouraged or permitted them to violate it for at least ten years.
The motion admits the truth of the factual averments in the answer. In consequence, it must be taken for granted that the feme defendant bought the land at 2512 Everett Avenue and erected a residence on it upon an understanding that the officials of the City of Raleigh would permit the premises to be used for business purposes in violation of the zoning ordinance putting such premises in a residence district; that at all times between the year 1938 and August 4, 1948, the officials of the City of Raleigh knowingly encouraged or permitted the defendants to devote the premises in question to business purposes in violation of the zoning ordinance restricting them to residential uses; and that the defendants *902 made substantial outlays of money in their business and upon their property in reliance upon their belief that the officials of the City of Raleigh would permit them to continue the use of the premises at 2512 Everett Avenue for commercial purposes in violation of the zoning ordinance.
Even so, the second issue of law raised by the plaintiff's motion must be resolved against the defendants.
The zoning ordinance was adopted by the City of Raleigh, a municipal corporation, under statutes originally embodied in Chapters 169 and 246 of the Public Local Laws of the Extra Session of 1921 and Chapter 250 of the Public Laws of 1923.
"A municipal corporation is dual in character and exercises two classes of powersgovernmental and proprietary. It has a twofold existenceone as a governmental agency, the other as a private corporation. Any activity of the municipality which is discretionary, political, legislative or public in nature and performed for the public good in behalf of the State, rather than for itself, comes within the class of governmental functions. * * * While acting `in behalf of the State' in promoting or protecting the health, safety, security, or general welfare of its citizens, it is an agency of the sovereign." Green v. Kitchin, 229 N.C. 450, 50 S.E.2d 545, 549; Millar v. Town of Wilson, 222 N.C. 340, 23 S.E.2d 42.
In enacting and enforcing zoning regulations, a municipality acts as a governmental agency and exercises the police power of the State. Kinney v. Sutton, 230 N.C. 404, 53 S.E.2d 306; City of Elizabeth City v. Aydlett, 201 N.C. 602, 161 S.E. 78; State v. Roberson, 198 N.C. 70, 150 S.E. 674. The police power is that inherent and plenary power in the state which enables it to govern, and to prohibit things hurtful to the health, morals, safety, and welfare of society. Drysdale v. Prudden, 195 N.C. 722, 143 S.E. 530; Skinner v. Thomas, 171 N.C. 98, 87 S.E. 976. L.R.A. 1916E, 338. In the very nature of things, the police power of the State can not be bartered away by contract, or lost by any other mode.
This being true, a municipality can not be estopped to enforce a zoning ordinance against a violator by the conduct of its officials in encouraging or permitting such violator to violate such ordinance in times past. Leigh v. City of Wichita, 148 Kan. 607, 83 P.2d 644, 119 A.L.R. 1503, and cases noted in the ensuing annotation. See these North Carolina decisions: Jenkins v. City of Henderson, 214 N.C. 244, 199 S.E. 37; State v. Finch, 177 N.C. 599, 99 S.E. 409; Bank v. Commissioners of Town of Oxford, 119 N.C. 214, 25 S.E. 966, 34 L.R.A. 487; State v. Bevers, 86 N.C. 588; Wallace v. Maxwell, 32 N.C. 110, 51 Am. Dec. 380; Candler v. Lunsford, 20 N.C. 542.
Undoubtedly this conclusion entails much hardship to the defendants. Nevertheless, the law must be so written; for a contrary decision would require an acceptance of the paradoxical proposition that a citizen can acquire immunity to the law of his country by habitually violating such law with the consent of unfaithful public officials charged with the duty of enforcing it.
The pertinent statute expressly provides that an injunction may be secured by a municipality to prevent a violation of a zoning ordinance. G.S. § 160-179.
For the reasons given, the judgment is
Affirmed.
