One pot preparation of pyrido[2,3,4-de]quinazolines and benzo[de][1,6]naphthyridines by a consecutive process involving an aza-Wittig/electrocyclic ring-closure/heterocumulene-mediated annelation or intramolecular Diels-Alder cycloaddition sequence.