
714 A.2d 1164 (1998)
Donald WAGNER and Rosemary Wagner, Husband and Wife, Appellants,
v.
BOROUGH OF RAINSBURG; Trudy Cessna Beegle, as Mayor and Chief of Police of Rainsburg Borough, and as an Individual, et al.
Commonwealth Court of Pennsylvania.
Submitted on Briefs April 16, 1998.
Decided July 17, 1998.
*1165 Dwight G. Diehl, Bedford, for appellants.
Dean A. Crabtree, Bedford, for appellees.
Before SMITH and FRIEDMAN, JJ., and McCLOSKEY, Senior Judge.
SMITH, Judge.
Donald and Rosemary Wagner appeal from the order of the Court of Common Pleas of Bedford County that sustained the preliminary objections in the nature of a demurrer filed by the Borough of Rainsburg et al. (Borough) and dismissed the Wagners' complaint in trespass against the Borough. The Wagners question the trial court's conclusion that they had to proceed against the Borough under the Eminent Domain Code[1] (Code) and that they were precluded from filing a lawsuit in trespass for the harms alleged in their complaint.
The Wagners own a parcel of real property in the Borough. They filed a complaint in trespass against the Borough alleging that Borough officials entered onto their property in May 1996 and directed a private contractor to place shale on their driveway; the driveway appears on the original plan of the Borough as an alley running along the southern border of the Wagners' property. The Wagners further alleged that the driveway is not a public alley, but is instead their private property, and that the Borough willfully disregarded their property rights and committed acts that amount to a taking of a portion of their property without just compensation. The Borough filed preliminary objections in the nature of a demurrer asserting, inter alia, that the Wagners' exclusive remedy for the acts alleged was under the Code. The trial court agreed with the Borough, sustained the Borough's preliminary objections and dismissed the Wagners' complaint, holding that under the case precedent of this Court the Wagners were precluded *1166 from filing an action in trespass against the Borough. This appeal followed.[2]
Preliminary objections in the nature of a demurrer challenge the legal sufficiency of a complaint, i.e. whether the complaint states a claim upon which relief can be granted. Pa. R.C.P. No. 1028(a)(4). In ruling on a demurrer, the trial court must accept as true all well-pleaded allegations of material fact and any inferences reasonably deducible therefrom, and a demurrer should be sustained only where it is certain that the law permits no recovery under the facts averred. O'Brien v. Township of Ralpho, 166 Pa. Cmwlth. 337, 646 A.2d 663 (1994), appeal denied, 544 Pa. 639, 675 A.2d 1254 (1996).
In its decision, the trial court erroneously concluded that there was a conflict between this Court's decision in Elser v. Pennsylvania Department of Transportation, 651 A.2d 567 (Pa.Cmwlth.1994), appeal denied, 540 Pa. 650, 659 A.2d 988 (1995), and Fulmer v. White Oak Borough, 146 Pa.Cmwlth. 473, 606 A.2d 589 (1992). The trial court concluded that the two decisions contained conflicting statements on whether a landowner must proceed under the Code for a municipality's actions that amount to a de facto taking or whether the landowner has the option of filing an action in trespass for damages to the property. The trial court, however, is incorrect in reaching its conclusion because Elser and Fulmer are not in conflict.
In Fulmer the Court recognized that the type of action that a landowner may file against a municipality depends on whether the municipality acted against the subject property for a public purpose. It further stated that acts not performed in the exercise of eminent domain and that are not the immediate, necessary or unavoidable consequence of that exercise cannot create a cause of action in eminent domain. The Court upheld the trial court's grant of summary judgment to the borough and against the landowners who sued in trespass rather than in eminent domain to recover damages for the borough's alleged negligence in creating an embankment on a hillside on the landowner's property, causing, inter alia, the increased potential for mud slides.
As the Court explained in Elser, a landowner is restricted to a trespass action where the landowner's deprivation of use and enjoyment of property results from the negligent act of another party who acts without the authority or direction of the entity clothed with the power of eminent domain. The Court in Elser cited Deets v. Mountaintop Area Joint Sanitary Authority, 84 Pa. Cmwlth. 300, 479 A.2d 49 (1984), for this proposition. However, the trial court concluded in the case sub judice that Deets had been overruled by the Court's decision in Fulmer when in fact the Court merely disavowed dicta in Deets that supported the notion that a landowner may elect to proceed in trespass or eminent domain when negligent acts are committed against a landowner's property by an entity clothed with the power of eminent domain.[3] The Court nonetheless held in Elser that because the Department of Transportation, an entity clothed with the power of eminent domain, authorized the dropping of stone onto the Elsers' property substantially impairing their access, they were entitled to damages for a de facto taking and were entitled to proceed under the Code. The Department's preliminary objections to the Elsers' petition for the appointment of a board of view alleged that its actions did not represent a taking and that the Elsers were not entitled to relief under the Code.
Despite the trial court's error in its analysis of the law the Court concludes that the Borough's preliminary objections were properly sustained because the Wagners' allegations describe what would, if proved, amount to the Borough's de facto taking of their property as in Elser or an intended *1167 exercise of eminent domain as the facts suggested in Fulmer. The Wagners never alleged that the deprivation and use of their property resulted from a party's negligence or other tortious acts. Accordingly, the Wagners' exclusive remedy is to institute proceedings under the Code, and they may not seek relief by filing an action in trespass against the Borough. The trial court's decision shall therefore be affirmed.

ORDER
AND NOW, this 17th day of July, 1998, the order of the Court of Common Pleas of Bedford County is affirmed.
NOTES
[1]  Act of June 22, 1964, Special Sess., P.L. 84, as amended, 26 P.S. §§ 1-101 - 1-903.
[2]  In reviewing a trial court's decision to sustain preliminary objections in the nature of a demurrer, this Court is limited to determining whether the trial court abused its discretion or committed an error of law. Baravordeh v. Borough Council of Prospect Park, 706 A.2d 362 (Pa.Cmwlth. 1998).
[3]  This Court has never overruled the holding in Deets, as evidenced by its citation in Elser and elsewhere.
