The cascade photoassisted synthetic strategy for accessing complex N,O-polyheterocycles of unprecedented molecular architecture is developed. It is based on intramolecular cycloadditions of aza-o-xylylenes formed in situ via excited-state intramolecular proton transfer (ESIPT) of o-acylanilides. The photoprecursors are synthesized via a two-step one-pot method from readily available starting materials. The photochemical cascade (one experimentally simple step) results in the formation of four new heterocyclic rings with high control of diastereoselectivity.