G.S. 1-77 provides that actions against a public officer or person especially appointed to execute his duties, for an act done by him by virtue of his office, must be tried in the county where the cause, or some part thereof, arose. Any consideration of G.S. 1-77 (2) involves two questions: (1) Is defendant a “public officer or person especially appointed to execute his duties”? (2) In what county did the cause of action in suit arise? Here plaintiffs make no contention that the cause of action arose elsewhere than in Sampson County. The crux of their argument is that the venue of this action is determined by G.S. 1-82, not ■by G.S. 1-77, for that defendant is not “a public officer.”
G.S. 1-77 does not expressly include within its provisions municipal or quasi-municipal corporations or their agents.
“(B)ut these are public agencies, created and recognized by law, and charged with public duties which they execute by and through their officers and agents. Actions against them are inherently local in their nature, in the absence of an express statute to the contrary, and sound public policy forbids that such officers should be required to forsake their civic duties and attend the courts of a distant forum.” McIntosh, North Carolina Practice and Procedure § 284 (1st Ed. 1929).
This Court early held that actions against counties must be brought in the county sued, Johnston v.. Commissioners, 67 N.C. 101, and, since “cities and towns are of the like nature, and should stand upon the same footing,” Jones v. Statesville, 97 N.C. 86, 88, 2 S.E. 346, 347, the principle was extended to actions against them. Ibid.; Godfrey v. Power Co., 224 N.C. 657, 32 S.E. 2d 27; Cecil v. High Point, 165 N.C. 431, 81 S.E. 616. See Powell v. Housing Authority, 251 N.C. 812, 112 S.E. 2d 386.
In Light Co. v. Commissioners, 151 N.C. 558, 66 S.E. 569, plaintiff Brevard Light and Power Company brought an action in the Superior Court of Transylvania County against the Light and Water Commis*334sioners of Concord, a corporation created by the legislature as an agency of the City of Concord, for a breach of contract to deliver certain machinery. When defendant’s motion to remove the action to Cabarrus County was denied, defendant appealed to this Court, which said,
“(T)he real question is whether the defendant is simply an agency of the city of Concord, charged with important duties, public in their nature. We think that it is ... . (T)he defendant’s motion to remove the action for trial to the county of Cabarrus, in which the city of Concord is situate, ought to have been allowed . . . "Id. at 560, 66 S.E. at 570.
Admittedly defendant is not a municipality in the sense of a political subdivision such as a city or a town or a quasi-municipality like a county. State ex rel. O’Neal v. Jennette, 190 N.C. 96, 98, 129 S.E. 184, 185. G.S. 131-126.28 does, however, declare the establishment, construction, maintenance and operation of hospital facilities to be public and governmental functions; and, under the provisions of G.S. 131-126.20 and G.S. 131-126.21 (a), Sampson County has delegated to defendant its authority to exercise these functions. Defendant is, therefore, an agency of Sampson County; and, under the facts here disclosed, if the cause of action arose in Sampson County, defendant is entitled to have the case tried there, G.S. 1-77; otherwise it must be tried in the county where the cause of action did arise, Murphy v. High Point, 218 N.C. 597, 12 S.E. 2d 1; McFadden v. Maxwell, 198 N.C. 223, 151 S.E. 250; Watson v. Mitchell, 108 N.C. 364, 12 S.E. 836.
Patently, this cause of action arose in Sampson County. Plaintiffs furnished to defendant there all the material and labor the value of which they now seek to recover in quantum valebant and in quantum meruit. The debt is the cause of action, and it arose where the debt originated. Steele v. Commissioners, 70 N.C. 137, 139. “A broad, general rule applied or stated in many cases is that the cause of action arises in the county where the acts or omissions constituting the basis of the action occurred.” Annot., Venue of actions or proceedings against public officers, 48 A.L.R. 2d 423, 432.
Judge Clark correctly treated defendant’s motion to dismiss as a motion for a change of venue. State ex rel. Cloman v. Staton, 78 N.C. 235. In the motion defendant had pointed out that Sampson County was the proper venue. Since this cause of action arose in Sampson County, G.S. 1-77 — subj ect to G.S. 1-83 — requires that the trial be had in Sampson County. Although the Recorder’s Court of Harnett County could not have removed the case to Sampson County, Lovegrove v. Lovegrove, 237 N.C. 307, 74 S.E. 2d 723, yet, when the action *335came to the Superior Court of Harnett County on appeal, the judge properly removed the case to the Superior Court of Sampson County. Upon the facts here disclosed it would have been error had the judge refused to remove the case. Dixon v. Haar, 158 N.C. 341, 74 S.E. 1. When an action is instituted in the wrong county, the Superior Court should, upon apt motion, remove the action, not dismiss it. G.S. 1-83; Wiggins v. Trust Co., 232 N.C. 391, 61 S.E. 2d 72; Godfrey v. Power Co., supra; Dixon v. Haar, supra; State ex rel. Cloman v. Staton, supra; McIntosh, op. cit. supra §§ 294-296. An appeal from a ruling on a motion for a change of venue under G.S. 1-77 is not premature. Cecil v. High Point, supra (appeal by plaintiff); Dixon v. Haar, supra (appeal by defendant).
Affirmed.