A convenient route to pentacyclic benzodiazepines and quinoxalines is reported, which simultaneously represent cyclic guanidines. Five new heterocyclic ring systems are described and the rules governing the regioselectivity of some of the ring closure reactions are studied. The structure of one of the products is confirmed by X-ray analysis. Scope and versatility of the process are indicated by several examples.