Herein, we present a new route to highly substituted pyrrolo[2,3-d]pyrimidines featuring a Ugi-Smiles/Sonogashira cascade followed by an efficient base-catalyzed intramolecular cyclization. When formaldehyde is chosen as input in the Ugi-Smiles step, aromatic fused systems are eventually obtained through the isomerization of an exo-alkylidene intermediate.