1,4-Benzodiazepine N-nitrosoamidines have been used as scaffolds for the preparation of different tricyclic derivatives. Replacement of the N-nitrosoamidine moiety through treatment with the nucleophiles acetylhydrazine, aminoacetaldehyde dimethylacetal and 1-amino-2-propanol, followed by an acid-catalyzed cyclization step, afforded triazolo and imidazobenzodiazepines 1, 6, and 7, respectively, in good yields. When acetylhydrazine is used as a nucleophile, the overall process provides an alternative route to alprazolam (1b) and triazolam (1c), respectively.