
156 S.E.2d 716 (1967)
271 N.C. 384
P. E. MOODY, trading and doing business as Frank Moody Funeral Home
v.
TRANSYLVANIA COUNTY.
No. 36.
Supreme Court of North Carolina.
September 20, 1967.
*717 Hamlin, Ramsey & White, by William R. White, Brevard, for plaintiff appellant.
Ramsey, Hill & Smart, by Ralph H. Ramsey, Jr., Brevard, for defendant appellee.
PLESS, Justice.
Two questions arise upon this appeal. Is ambulance service a necessary expense for which the County Commissioners may legally contract? If such contract is ultra vires, must it be pleaded by the defendant, or is it proper ground for demurrer? The appellant's position cannot be sustained on either question.
In Madry v. Town of Scotland Neck, 214 N.C. 461, 199 S.E. 618, Barnhill, J. (later C.J.) made this concise statement:
"A municipality is a creature of the Legislature and it can only exercise (1) the powers granted in express terms; (2) those necessarily or fairly implied in or incident to the powers expressly granted; and (3) those essential to the accomplishment of the declared objects of the corporationnot simply convenient, but only those which are indispensable, to the accomplishment of the declared objects of the corporation. In exercising such powers the municipal corporation's authority to bind itself by contract is limited and it cannot contract any debt, except for necessary expenses, unless by vote of the majority of the qualified voters therein." Citations omitted.
While that case involved a city rather than a county, the same rule would apply to the latter.
When the questioned contract was made in Sept. 1964, the County Commissioners did not have the power "in express terms" to provide ambulance service. Without the "express" authority, we must determine whether the object of the purported contract was "essential to the accomplishment of the declared objects (of the County) * * * not simply convenient, but * * * indispensable to the declared objects" (of the County).
In Palmer v. Haywood County, 212 N.C. 284, 193 S.E. 668, 113 A.L.R. 1195, the plaintiff sought an order to restrain the County Commissioners from issuing bonds *718 to provide funds to construct an addition to the county hospital. The Superior Court denied the order, and in reversing it, this Court said:
"What are necessary expenses is a question for judicial determination. The judicial decisions in this state uniformly so hold. `"The courts determine what class of expenditures made or to be made by a municipal corporation come under the definition of `necessary expenses.' The governing authorities of the municipal corporations are vested with the power to determine when they are needed." * * * That is to say, the courts determine whether a given project is a necessary expense of a municipality, but the governing authorities of the municipality determine in their discretion whether such given project is necessary or needed in the designated locality.'
"In defining `necessary expense,' it is said in Henderson v. [City of] Wilmington, supra [191 N.C. 269, 132 S.E. 25]: `We derive practically no aid from the cases decided in other states. * * * We must rely upon our own decisions.' Then, after reviewing numerous cases dealing with the subject of `necessary expense,' 191 N.C. 269, at page 278, 132 S.E. 25, 30, Adams, J., said: `The cases declaring certain expenses to have been "necessary" refer to some phase of municipal government. This court, so far as we are advised, has given no decision to the contrary.' Then continues, 191 N.C. 269, at page 279, 132 S.E. 25, 30: `The decisions heretofore rendered by the court make the test of a "necessary expense" the purpose for which the expense is to be incurred. If the purpose is the maintenance of the public peace or the administration of justice; if it partakes of a governmental nature or purports to be an exercise by the city of a portion of the State's delegated sovereignty; if, in brief, it involves a necessary governmental expense.'
"This court has repeatedly held that the building, maintenance, and operation of public hospitals is not a `necessary expense.'" Citations omitted.
To hold that the County may provide transportation at public expense to a hospital whose operation is not a necessary public expense would be incongruous and inconsistent. We therefore hold that the Commissioners could not legally contract for such service, and that their attempt to do so was ultra vires.
The plaintiff cites several statutes and decisions in support of his position, but an examination of each of them discloses a distinction between them and the present question. G.S. § 153-2(3) deals with the corporate powers of the counties in broad terms but has no explicit reference to the power sought here. G.S. § 153-176.1 authorizes counties having a population of 60,000 or over to provide hospitalization for the indigent sick, but this does not apply to Transylvania County, which has less than half the required population. G.S. § 131-28.3 and .4 deals with the authority of the counties to own and support hospitals by bonds authorized by the voters.
G.S. § 153-9(58) does authorize the counties to contract for ambulance service, but it was not enacted until 1967, while the contract must be construed as of its date, which was September 1964.
The case of Harrison v. New Bern, 193 N.C. 555, 137 S.E. 582, is distinguishable here because it involved the purchase of ninety-three acres of land for use as a cemetery; and at the time the suit was brought, the transaction had been completed. The Court held that the action of the City in purchasing the lands and paying for them was ultra vires, but that since the transaction had been fully performed, it should be permitted to stand. Morgan v. Town of Spindale, 254 N.C. 304, 118 S.E.2d 913, involved the issuance of bonds by the Town following an election in favor of them; and Turner v. City of Reidsville, *719 224 N.C. 42, 29 S.E.2d 211, also involved bonds issued after approval by the voters of the City. The other cited authorities do not, in our opinion, sustain the plaintiff's position.
The plaintiff further contends that the demurrer should not have been sustained for that the action of the County Commissioners did not appear invalid upon the face of the complaint and that it should have been required to answer. However, the plaintiff seeks to recover upon a contract allegedly made by the County Commissioners. That, without more, raises the question of their authority, and a demurrer seeks an immediate answer. The pleading should be liberally construed with a view to substantial justice between the parties, giving the pleader the benefit of every reasonable intendment in his favor. It admits the truth of the factual averments well stated and the relevant inferences of fact reasonable deducible therefrom. 3 Strong's N. C. Index, Pleadings, § 12, and many cases there cited.
"`The office of the demurrer is to test the sufficiency of a pleading, admitting, for the purpose, the truth of the allegations of facts contained therein, and ordinarily relevant inferences of fact, necessarily deducible therefrom, are also admitted * * *'." Mallard v. Eastern Carolina Regional Housing Authority, 221 N.C. 334, 20 S.E.2d 281.
In Madry v. Town of Scotland Neck, supra, the Court said:
"`If a contract is ultra vires it is wholly void and (1) no recovery can be had against the municipality; (2) there can be no ratification except by the Legislature; (3) the municipality cannot be estopped to deny the validity of the contract. 3 McQuillin, Municipal Corporations, 2nd Ed., page 817.' Jenkins v. City of Henderson, 214 N.C. 244, 199 S.E. 37, 40. The fact that the other party to the contract has fully performed his part of the contract, or has expended money on the faith thereof, will not preclude the city from pleading ultra vires. City Council of Dawson v. Dawson Waterworks, 106 Ga. 696, 32 S.E. 907; Mealy v. Hagerstown, 92 Md. 741, 48 A. 746; Jenkins v. Henderson, supra.
"As it appears upon the face of the complaint that the plaintiff is seeking to enforce a contract which is ultra vires and void the demurrer interposed by the defendant should have been sustained."
The complaint contains the following allegation: "(I)n entering into this contract the Board of County Commissioners of Transylvania County were acting within the scope of their authority as the governing body for Transylvania County." That squarely presents the question involved here; and we can see no practical reason why the County should be required to answer when, as stated in Madry v. Town of Scotland Neck, supra, "As it appears on the face of the complaint that the plaintiff is seeking to enforce a contract which is ultra vires and void the demurrer interposed by the defendant should have been sustained."
In his brief the plaintiff takes the position that defendant is estopped to deny the validity of the contract.
"A city is not estopped from pleading ultra vires in defense of an action on contract by the fact that the other party to the contract expended money to perform his part of the agreement. Mealy v. Hagerstown, 92 Md. 741, 48 A. 746. The fact that the other party to the contract has fully performed his part of the contract, or has expended money on the faith thereof, will not preclude the city from pleading ultra vires. City Council of Dawson v. Dawson Waterworks Co., 106 Ga. 696, 32 S.E. 907; Mealy v. Hagerstown, supra. No subsequent action on the part of the municipal corporation will prevent it from denying the validity of such contract." Jenkins v. Henderson, 214 N.C. 244, 199 S.E. 37.
*720 The contention of the plaintiff that the contract had been largely executed by it, that the County had accepted the benefits of it, and had made two of the monthly payments, and that it was therefore estopped to deny its responsibility, cannot be sustained. In 38 Am.Jur. 202, Municipal Corporations § 522, it is said:
"As a general rule, the doctrine of estoppel cannot be applied as against a municipal corporation to validate a contract which it has no power to make, * * * although the corporation has accepted the benefits thereof and the other party has fully performed his part of the agreement, or has expended large sums in preparation for performance. * * * to apply the doctrine of estoppel against a municipality in such case would be to enable it to do indirectly what it cannot do directly * * * The law holds those dealing [with the County] to a knowledge of the extent of the power * * * and of any restrictions imposed * * * (P)ersons dealing with a municipal corporation are charged with notice of all limitations upon the authority of its officers representing them * * *" See also Jenkins v. Henderson, supra; Burgin v. Smith, 151 N.C. 561, 66 S.E. 607, and Board of Managers, etc. v. City of Wilmington, 237 N.C. 179, 74 S.E.2d 749.
The plaintiff's prayer for relief is (1) "That he * * * recover a sum of $333.33 for each calendar month from and after November 10, 1964, to the date of the filing of this complaint," etc.; and (2) "That a writ of mandamus issue * * * ordering the governing body of the defendant to continue with the terms of its contract" etc.
In St. George v. Hanson, 239 N.C. 259, 78 S.E.2d 885, Parker, J. (now C. J.) said for the Court:
"We have said in many cases that a party seeking a writ of mandamus must have a clear legal right to demand it, and the party to be coerced must be under a positive legal obligation to perform the act sought to be required. Hancock v. Bulla, 232 N.C. 620, 61 S.E.2d 801; Laughinghouse v. City of New Bern, 232 N.C. 596, 61 S.E.2d 802; Steele v. Locke Cotton Mills Co., 231 N.C. 636, 58 S.E.2d 620; Ingle v. State Board of Elections, 226 N.C. 454, 38 S.E.2d 566; White v. Holding, 217 N.C. 329, 7 S.E.2d 825; Mears v. Board of Education, 214 N.C. 89, 197 S.E. 752; Person v. Doughton, 186 N.C. 723, 120 S.E. 481. `A mandatory injunction, when issued to compel a board or public official to perform a duty imposed by law, is identical in its function and purpose with that of a writ of mandamus. * * * Such writ (a mandamus) will not be issued to enforce an alleged right which is in question.' Board of Managers of James Walker Memorial Hospital of City of Wilmington, N. C. v. City of Wilmington, 235 N.C. 597, 70 S.E.2d 833; Harris v. Board of Education, 216 N.C. 147, 4 S.E.2d 328.
"It is well settled law that mandamus cannot be invoked to control the exercise of discretion of a board, officer, or court when the act complained of is judicial or quasi-judicial, unless it clearly appears that there has been an abuse of discretion. The function of the writ is to compel the performance of a ministerial dutynot to establish a legal right, but to enforce one which has been established. Hayes v. Benton, 193 N.C. 379, 137 S.E. 169; Wilkinson v. Board of Education, 199 N.C. 669, 155 S.E. 562; Harris v. Board of Education, supra."
Also, in Thomas v. State Board of Elections, 256 N.C. 401, 124 S.E.2d 164, it is said:
"`* * * Mandamus is an action or proceeding of a civil nature, extraordinary in the sense that it can be maintained only when there is no other adequate remedy and designed to enforce clear legal rights or the performance of *721 ministerial duties which are enjoined by law; but the writ will not be issued to enforce an alleged right which is in doubt. Not only must the plaintiff show that he has a clear legal right; he must show that the opposing party is under legal obligation to perform the act or to grant the relief for the performance or enforcement of which the action is prosecuted. * * *" McIntosh, North Carolina Practice and Procedure, Second Edition, Volume 2, Section 2445."
The plaintiff has not established "a clear legal right" to demand mandamus, nor that the defendant is "under a positive legal obligation to perform the act sought to be required."
The judgment of the Court below was correct, and it is hereby
Affirmed.
