Lithiation of N-benzyl pyridine and quinoline carboxamides alpha to nitrogen gives anions that undergo intramolecular attack on the pyridine or quinoline ring, either directly or on activation of the ring by N-acylation. The resulting four-, five-, or six-membered-ring-containing compound may be oxidized, protonated, alkylated, or acylated to give a range of polycyclic heterocycles, including pyrrolopyridines, pyrroloquinolines, benzonaphthyridines, and azaspirocyclic beta-lactams. [reaction: see text]