In this work, efficient and high-yielding green synthesis of 3,4‐dihydropyrimidin‐2‐(1H)‐ones and 3,4‐dihydropyrimidin‐2‐(1H)‐thiones was achieved by a one-pot three-component reaction between aldehydes, ethyl acetoacetate, and urea/thiourea, using a recyclable mesoporous nanocatalyst entitled nano-N,N,N',N'-tetramethyl-N-(silica-n-propyl)-N'-sulfo-ethane-1,2-diaminium chloride (nano-[TSPSED][Cl]2). High yields, short reaction times, solvent-free conditions, easy purification of the products, compliance with green chemistry protocols and recyclability of the catalyst are the benefits of this work. The products were obtained in 80-98 % yields and in 10-45 min.