
96 Pa. Commonwealth Ct. 221 (1986)
506 A.2d 1015
Nancy Frank, in her own right and as Administratrix of the Estate of Ronald A. Frank, Deceased, Appellant
v.
Southeastern Pennsylvania Transportation Authority and City of Philadelphia, Appellees.
No. 1 T.D. 1985.
Commonwealth Court of Pennsylvania.
Argued December 10, 1985.
April 2, 1986.
*222 Argued December 10, 1985, before President Judge CRUMLISH, JR., Judge BARRY, and Senior Judge BLATT, sitting as a panel of three.
Sol H. Weiss, with him, Gail P. Roth, Anapol, Schwartz, Weiss & Schwartz, for appellant.
Barbara R. Axelrod, Divisional Deputy in Charge of Appeals, with her, Barbara W. Mather, City Solicitor, and Armando A. Pandola, Jr., Chief Deputy in Charge of Claims, for appellees.
OPINION BY JUDGE BLATT, April 2, 1986:
Nancy Frank (appellant) appeals here an order of the Court of Common Pleas of Philadelphia County which sustained preliminary objections in the nature of a demurrer raised by the City of Philadelphia (City) to a complaint the appellant filed against the City on behalf of herself and Ronald Frank (decedent).
The complaint alleges in pertinent part that the Southeastern Pennsylvania Transportation Authority (SEPTA) and the City owned, operated, maintained and controlled the Market-Frankford Elevated train system *223 (El), as well as the property located adjacent to each station along the El, at all times relevant to the complaint. It further alleges that, prior to and including the date in question, SEPTA had eliminated cashiers and security guards at the Somerset station after 11:00 P.M., after which time fares would be collected on the train itself; that the station platform had a roof purported to be in a hazardous condition because it extended over the train tracks, thus providing access to the top of trains; and that SEPTA had previously engaged private police to deter persons from gaining access to the tops of the trains by way of this platform roof. After 11:00 P.M. on the date in question, the decedent allegedly proceeded to the Somerset platform, climbed on top of the roof, jumped therefrom onto a southbound train which had arrived at the station, and subsequently died while riding on top of the train when he struck a bridge trestle. The appellant alleged that the City was negligent, inter alia, in failing to warn of the risk of climbing on top of the train and in failing to use barriers to prevent minors from gaining access to the roof and thence onto the train.
The trial court determined that the appellant's action was precluded pursuant to the terms of Section 8541 of the Judicial Code, 42 Pa. C. S. §8541, which grants immunity to local agencies[1] from damages on account of any injury to a person caused by the action of the agency, any of its employees, or any other person. The trial court specifically rejected the appellant's assertion that the action fell within one of the eight enumerated exceptions to the grant of immunity listed in Section 8542 of the Judicial Code, 42 Pa. C. S. §8542. *224 The appellant contends here that the facts alleged place this action within the "real property exception" established by Section 8542(b) (3) of the Judicial Code, which pertinently provides:
(b) Acts which may impose liability.  The following acts by a local agency or any of its employees may result in the imposition of liability on a local agency:
* * * *
(3) Real Property.  The care, custody or control of real property in the possession of the local agency, except that the local agency shall not be liable for damages on account of any injury sustained by a person intentionally trespassing on real property in the possession of the local agency.
42 Pa. C. S. §8542(b) (3).
For purposes of ruling upon a demurrer, of course, all well-pleaded facts must be accepted as true, as well as all reasonable inferences which may be deduced therefrom. Wolcott v. Athens Area School District, 62 Pa. Commonwealth Ct. 491, 437 A.2d 98 (1981). Additionally, a demurrer may not be sustained unless the law will not permit recovery, and all doubts must be resolved in favor of overruling it, Aiken v. Radnor Township Board of Supervisors, 83 Pa. Commonwealth Ct. 190, 476 A.2d 1383 (1984).
Assuming, for purposes of the demurrer, that the City actually possessed the premises in question, it is nonetheless apparent that the gravamen of the appellant's complaint concerns the City's failure to supervise the activity of the decedent's own activities upon the subject premises. And, as we have held previously, the failure to properly supervise activity does not fall within the ambit of the real property exception created by 42 Pa. C. S. §8542(b) (3), merely because the activity at *225 issue occurred on the agency's property. For example, in Robson v. Penn Hills School District, 63 Pa. Commonwealth Ct. 250, 437 A.2d 1273 (1981), we stated that it would totally distort the language of the real property exception to place the supervision of school children, or the lack thereof, within its scope, and we believe that a similar result is required here, where it was the failure to supervise the victim's activity which led to his injury. Moreover, nothing in the pleadings demonstrates a significant relationship between the alleged dangerous condition and the decedent's death to trigger the application of the real property exception, which would have been implicated, for example, had the decedent fallen from the roof or been injured by its collapse.
We must additionally note that the appellant's averments unequivocally indicate that the decedent was trespassing by climbing to the roof and train top, areas to which the public was not invited, as clearly demonstrated by the appellant's own averments that SEPTA had previously engaged security guards to prevent such activity.[2] The statute expressly provides that, notwithstanding the applicability of the real property exception, "a local agency shall not be liable for damages on account of any injury sustained by a person intentionally trespassing on real property in the possession of the local agency." 42 Pa. C. S. §8542(b) (3) (emphasis added). Such language clearly evinces the legislative intent to prevent trespassers from availing themselves of the advantage otherwise created by the real property immunity exception. We believe, therefore, that the trial court *226 correctly sustained the demurrer to the appellant's complaint. We will affirm the court's order.

ORDER
AND NOW, this 2nd day of April, 1986, the order of the Court of Common Pleas of Philadelphia County dated December 16, 1984 concerning the above-captioned matter is affirmed.
NOTES
[1]  Section 8501 of the Judicial Code, 42 Pa. C. S. §8501 provides that a local agency is "a government unit other than the Commonwealth government", a definition here applicable to the City.
[2]  Restatement (Second) of Torts, §341 comment b (1977) provides that one permitted to enter land for a particular purpose becomes a trespasser upon entering another part of the land. See also Whigham v. Pyle, 224 Pa. Superior Ct. 6, 302 A.2d 498 (1973) (child permitted to enter portion of land becomes trespasser if he enters another portion).
