The synthesis of seven-membered nitrogen heterocycles by silyl-aza-Prins cyclization is described. The process provides trans-azepanes in high yields and good to excellent diastereoselectivities. Moreover, the reaction outcome is dependent on the Lewis acid employed. Thus, while azepanes are selectively obtained when InCl3 is used, the reaction in the presence of TMSOTf provides tetrahydropyran derivatives corresponding to a tandem Sakurai-Prins cyclization.