Synthesis of 2,3- and 3,4-cyclopentenopyridines, 5,6,7,8-tetrahydroquinolines and 5,6,7,8-tetrahydroisoquinolines from 1,2,4-triazine derivatives is reported. Introduction of an alpha-functionalized methyl substituent (e.g. arylsulphonyl, sulphonamide, sulphonic acid ester) into position 3- or 6- of triazines by vicarious nucleophilic substitution of hydrogen and subsequent alkylation with alkyl iodides bearing an acetylenic function in terminal position afforded valuable intermediates for intramolecular Diels-Alder reaction with inverse electron demand. When heated at higher temperature, these triazine derivatives gave the Diels-Alder cycloadducts, which, after spontaneous extrusion of nitrogen moiety, led to a variety of functionalized cycloalkenopyridine derivatives.