Reaction of pyrone 1a or tetronic acid 1b with o-phenylenediamine derivatives gave enaminone compounds 2. When reacting with different electrophiles, these intermediates allowed versatile access to different heterocyclic structures: when DMA derivatives or triphosgene was used, cyclization occurred through nitrogen, leading to benzimidazoles 3 and benzimidazolones 4, respectively, while reaction with