A highly efficient and selective reaction for the synthesis of 2-substituted benzoxazoles and benzimidazoles catalyzed by Au/TiO2 has been developed via two hydrogen-transfer processes. This reaction has a good tolerance to air and water, a wide substrate scope, and represents a new avenue for practical C-N and C-O bond formation. More importantly, no additional additives, oxidants and reductants are required for the reaction and the catalyst can be recovered and reused readily.