
    442 A.2d 324
    Richard L. BROWN, Isabelle A. Brown, James F. Haberkorn, and Mary Elizabeth Haberkorn, Appellants, v. Paul A. COONEY, Charles M. Cooney and James R. Cooney, trading and doing business as Cooney Bros. Coal Co., a partnership, and Adams Township.
    Superior Court of Pennsylvania.
    Argued Feb. 11, 1981.
    Filed March 5, 1982.
    
      Edward F. Peduzzi, Ebensburg, for appellants.
    John A. Metz, Jr., Pittsburgh, for Cooney, etc., appellees.
    Mark Gregg, Johnstown, for Adams Tp., appellee.
    Before BROSKY, DiSALLE and SHERTZ, JJ.
   SHERTZ, Judge:

This is an appeal from the order of the court below granting summary judgment to Appellee defendants. The trial court concluded that Appellants’ complaint was barred by res judicata. On appeal, Appellants contend that their complaint was not barred by res judicata and was timely filed within the statute of limitations. We disagree and accordingly affirm the order of the court below.

The pertinent facts are as follows. Appellants filed a complaint in equity against Appellees on November 24,1975. Therein Appellants averred therein that Appellee Township had vacated Township Road 309 which passed between properties owned by Appellants. Appellants further claimed that they acquired title to the road and that during the period from July to October 1974, without permission of the Township or Appellants, Cooney Bros, had covered the road with fill rendering it useless. Appellants also claimed that some of the fill covered portions of Appellants’ adjacent properties. Appellants sought to compel Appellees to remove the fill, to restore the road and for the use of the road on a wheelage or tonnage basis. Appellee Township and Appellee Cooney Bros, each demurred, claiming that the road was not vacated by the Township. The Chancellor, concluding that the road had not been vacated, entered an order sustaining the demurrers and dismissing the complaint. Appellants took no action to challenge the propriety of said order.

On August 24, 1979, Appellants filed a complaint in trespass; it is this complaint which is the subject of this appeal. Appellants reiterate their previous claim that the road was vacated by the Township and that Appellee Cooney Bros, covered the road and adjacent property with fill. Additionally, Appellants claim that:

The defendants, Cooney Bros., also cut through and across a certain portion of plaintiffs’ land, constructing a new road thereon, by and with the consent and permission of defendant, Adams Township, but without the consent and permission of the plaintiffs.

R.R. at 34a. Appellants concede that Cooney Bros, proceeded with permission from the Township and that there is no record that the road was deleted from the Township road system.

Appellee Township filed a motion for summary judgment on the ground that the action was barred by res judicata and the applicable statute of limitations. Appellee Cooney Bros, filed a motion on the ground that the action was barred by the applicable statute of limitations.

Since the statute of limitations question was the only one raised in both motions for summary judgment, we consider it first. Appellants do not dispute that they failed to bring the present action within the two-year limitation period prescribed for an action for waste or trespass of real property, 42 Pa.Cons.Stat.Ann. § 5524(4) (Purdon Pamphlet 1981), or within the one year extension provided for actions pending when a statute of limitations is reduced. See Section 25(a) and (b) of the Act of July 9, 1976, P.L. 586, No. 142. Rather Appellants argue that the action was properly brought pursuant to 42 Pa.Cons.Stat.Ann. § 5535 (Purdon Pamphlet 1981) which provides as follows:

(a) Termination of prior matter.—
(1) If a civil action or proceeding is timely commenced and is terminated, a party, or his successor in interest, may, notwithstanding any other provision of this subchapter, commence a new action or proceeding upon the same cause of action within one year after the termination and any other party may interpose any defense or claim which might have been interposed in the original action or proceeding.
(2) Paragraph (1) does not apply to:
(i) An action to recover damages for injury to the person or for the death of an individual caused by the wrongful act or neglect or unlawful violence or negligence of another.
(ii) An action or proceeding terminated by a voluntary non-suit, a discontinuance, a dismissal for neglgect to prosecute the action or proceeding, or a final judgment upon the merits.

Appellants contend that the Chancellor’s order sustaining the demurrer and dismissing Appellants’ initial complaint was not a “final judgment upon the merits” within the meaning of Section 5535. This contention is unsupported by case law or other relevant authority. Dismissal of an action for failure to state a claim is a final judgment on the merits. See e.g. Coggins v. Carpenter, 468 F.Supp. 270 (E.D.Pa. 1979). Where the facts alleged by the plaintiff present the issue on which the court holds that no cause of action exists, determination of that issue is “on the merits.” 50 C.J.S. Judgments § 633, p. 67 (1947).

Restatement, Judgments § 49, Comment a (1942) summarizes the distinction between a judgment on the merits and a judgment which is not on the merits:

“A judgment for the defendant is not on the merits where it is based merely on rules of procedure rather than on rules of substantive law. If the judgment determines that the plaintiff has no cause of action, it is on the merits; but if it determines only that the plaintiff is not entitled to recover in the particular action, it is not on the merits. If the defendant, whether on demurrer, motion, verdict or otherwise, obtains judgment in his favor on a ground not involving the substance of the plaintiffs cause of action, the cause of action is not extinguished thereby. This is the case, for example, where the judgment is based on the lack of jurisdiction of the court over the defendant or over the subject of the action, on the plaintiff’s lack of capacity to sue, on the pendency of a prior action, on the misjoinder or nonjoinder of parties or on the misjoinder of causes of action.” (emphasis added)

The Chancellor’s order sustaining the demurrer to the complaint in equity was on the ground that Appellants had no cause of action inasmuch as “Adams Township was the legal holder of Road No. 309”. If Appellants wished to challenge the Chancellor’s order, an appeal could have been taken.

Having concluded that the the instant action was commenced beyond the period permitted by the applicable statute of limitations, we need not decide whether all or part of the second complaint is barred by res judicata or collateral estoppel.

Affirmed.

This case was decided prior to the expiration of SHERTZ, J.’s commission of office.

DiSALLE, J., did not participate in the consideration or review of this case. 
      
      . Where the court sustains a demurrer and dismisses the complaint, such order is final and appealable. Brown v. Kleinfelter, 267 Pa.Super.Ct. 144, 406 A.2d 560 (1979).
     